mirror of
https://github.com/YGGverse/ggemini.git
synced 2026-03-31 09:05:45 +00:00
add alias getters test
This commit is contained in:
parent
5229cdae85
commit
f513747e86
2 changed files with 7 additions and 1 deletions
|
|
@ -58,6 +58,7 @@ impl Permanent {
|
|||
#[test]
|
||||
fn test() {
|
||||
const BUFFER: &str = "31 gemini://geminiprotocol.net/path\r\n";
|
||||
let bytes = BUFFER.as_bytes();
|
||||
let base = Uri::build(
|
||||
glib::UriFlags::NONE,
|
||||
"gemini",
|
||||
|
|
@ -68,7 +69,9 @@ fn test() {
|
|||
Some("query"),
|
||||
Some("fragment"),
|
||||
);
|
||||
let permanent = Permanent::from_utf8(BUFFER.as_bytes()).unwrap();
|
||||
let permanent = Permanent::from_utf8(bytes).unwrap();
|
||||
assert_eq!(permanent.as_str(), BUFFER);
|
||||
assert_eq!(permanent.as_bytes(), bytes);
|
||||
assert!(permanent.target().is_ok());
|
||||
assert!(
|
||||
permanent
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ impl Temporary {
|
|||
#[test]
|
||||
fn test() {
|
||||
const BUFFER: &str = "30 gemini://geminiprotocol.net/path\r\n";
|
||||
let bytes = BUFFER.as_bytes();
|
||||
let base = Uri::build(
|
||||
glib::UriFlags::NONE,
|
||||
"gemini",
|
||||
|
|
@ -69,6 +70,8 @@ fn test() {
|
|||
Some("fragment"),
|
||||
);
|
||||
let temporary = Temporary::from_utf8(BUFFER.as_bytes()).unwrap();
|
||||
assert_eq!(temporary.as_str(), BUFFER);
|
||||
assert_eq!(temporary.as_bytes(), bytes);
|
||||
assert!(temporary.target().is_ok());
|
||||
assert!(
|
||||
temporary
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue