Skip to content

Commit 4a4d2c6

Browse files
committed
test
1 parent ef87f1c commit 4a4d2c6

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

src/parser.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,4 +298,21 @@ mod tests {
298298
}
299299
Ok(())
300300
}
301+
302+
#[test]
303+
fn test_multiline_qa() -> Fallible<()> {
304+
let input = "Q: foo\nbaz\nbaz\nA: FOO\nBAR\nBAZ";
305+
let parser = make_test_parser();
306+
let cards = parser.parse(input)?;
307+
308+
assert_eq!(cards.len(), 1);
309+
match &cards[0].content() {
310+
CardContent::Basic { question, answer } => {
311+
assert_eq!(question, "foo\nbaz\nbaz");
312+
assert_eq!(answer, "FOO\nBAR\nBAZ");
313+
}
314+
_ => panic!("Expected basic card"),
315+
}
316+
Ok(())
317+
}
301318
}

0 commit comments

Comments
 (0)