diff options
author | Joris | 2024-10-14 22:30:47 +0200 |
---|---|---|
committer | Joris | 2024-10-14 22:30:47 +0200 |
commit | 924b10b0cd6c09fa7afa58e6f7a068646d1e56af (patch) | |
tree | 3f20b5db131e54ceb73f6e2b932525e9fe6f2c63 /src/sync.rs | |
parent | a126fba82cb4f9f4467b130fca7fd5a269fe3a5e (diff) |
Use nom to parse linesmain
Diffstat (limited to 'src/sync.rs')
-rw-r--r-- | src/sync.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/sync.rs b/src/sync.rs index 6e3d84b..974e838 100644 --- a/src/sync.rs +++ b/src/sync.rs @@ -113,7 +113,7 @@ mod tests { #[test] fn test_added() { - let diff = deck_diff("- A : a", "- A : a\n- B : b"); + let diff = deck_diff("A : a", "A : a\nB : b"); has_questions(diff.new, vec![("B", vec!["b"]), ("b", vec!["B"])]); assert!(diff.deleted.is_empty()); @@ -122,7 +122,7 @@ mod tests { #[test] fn test_updated() { - let diff = deck_diff("- A : a1", "- A : a2"); + let diff = deck_diff("A : a1", "A : a2"); has_questions(diff.new, vec![("A", vec!["a2"]), ("a2", vec!["A"])]); has_questions(diff.deleted, vec![("A", vec!["a1"]), ("a1", vec!["A"])]); @@ -131,7 +131,7 @@ mod tests { #[test] fn test_deleted() { - let diff = deck_diff("- A : a", ""); + let diff = deck_diff("A : a", ""); assert!(diff.new.is_empty()); has_questions(diff.deleted, vec![("A", vec!["a"]), ("a", vec!["A"])]); @@ -146,7 +146,7 @@ mod tests { deleted: Some(0), }]; - let diff = super::diff(db_entries, deck::tests::read_string("- A : a").unwrap()); + let diff = super::diff(db_entries, deck::tests::read_string("A : a").unwrap()); has_questions(diff.new, vec![("a", vec!["A"])]); assert!(diff.deleted.is_empty()); @@ -154,7 +154,7 @@ mod tests { } #[test] fn regroup_same_question() { - let diff = deck_diff("", "- A : a\n- A | B : b"); + let diff = deck_diff("", "A : a\nA | B : b"); has_questions( diff.new, |