mirror of
https://github.com/YGGverse/ggemtext.git
synced 2026-03-31 09:05:32 +00:00
fix method name, add missed test condition
This commit is contained in:
parent
9696efa02d
commit
1b43f6aeaf
1 changed files with 6 additions and 4 deletions
|
|
@ -19,7 +19,7 @@ impl List {
|
||||||
// Converters
|
// Converters
|
||||||
|
|
||||||
/// Convert `Self` to [Gemtext](https://geminiprotocol.net/docs/gemtext-specification.gmi) line
|
/// Convert `Self` to [Gemtext](https://geminiprotocol.net/docs/gemtext-specification.gmi) line
|
||||||
pub fn as_source(&self) -> String {
|
pub fn to_source(&self) -> String {
|
||||||
self.value.to_source()
|
self.value.to_source()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -45,10 +45,12 @@ fn test() {
|
||||||
const SOURCE: &str = "* Item";
|
const SOURCE: &str = "* Item";
|
||||||
const VALUE: &str = "Item";
|
const VALUE: &str = "Item";
|
||||||
|
|
||||||
// test struct
|
// test `List`
|
||||||
assert_eq!(List::parse(SOURCE).unwrap().value, VALUE);
|
let list = List::parse(SOURCE).unwrap();
|
||||||
|
assert_eq!(list.value, VALUE);
|
||||||
|
assert_eq!(list.to_source(), SOURCE);
|
||||||
|
|
||||||
// test trait
|
// test `Gemtext`
|
||||||
assert_eq!(SOURCE.as_value(), Some(VALUE));
|
assert_eq!(SOURCE.as_value(), Some(VALUE));
|
||||||
assert_eq!(VALUE.to_source(), SOURCE)
|
assert_eq!(VALUE.to_source(), SOURCE)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue