impl Parseable trait

This commit is contained in:
John Turner
2025-10-28 09:44:32 +00:00
parent 92a8e46082
commit b54616a6dd
6 changed files with 367 additions and 272 deletions

View File

@@ -334,14 +334,14 @@ impl fmt::Display for Atom {
mod test {
use mon::{Parser, input::InputIter};
use crate::atom::parsers;
use super::*;
use crate::Parseable;
#[test]
fn test_version_display() {
let s = "1.0.0_alpha1_beta1-r1";
let version = parsers::version()
.parse_finished(InputIter::new(s))
.unwrap();
let version = Version::parser().parse_finished(InputIter::new(s)).unwrap();
assert_eq!(version.to_string().as_str(), s);
}
@@ -349,7 +349,7 @@ mod test {
#[test]
fn test_display_atom() {
let s = "!!>=foo/bar-1.0.0v_alpha1_beta1-r1:slot/sub=[a,b,c]";
let atom = parsers::atom().parse_finished(InputIter::new(s)).unwrap();
let atom = Atom::parser().parse_finished(InputIter::new(s)).unwrap();
assert_eq!(atom.to_string().as_str(), s);
}