From: Ian Jackson Date: Sun, 15 May 2022 14:36:49 +0000 (+0100) Subject: subst test: Add many dbg calls X-Git-Tag: otter-1.1.0~111 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=b72b93db11d9fb308acf8ed0182316c9c164b52e;p=otter.git subst test: Add many dbg calls It turns out that I can make these fail and having it debug is useful. Signed-off-by: Ian Jackson --- diff --git a/src/shapelib.rs b/src/shapelib.rs index 6bf29ebf..bb2804a2 100644 --- a/src/shapelib.rs +++ b/src/shapelib.rs @@ -1179,11 +1179,11 @@ fn test_subst_mf1() { .unwrap().finish().unwrap(), "a die"); assert!{matches!{ - subst(s_t("a die"), "_colour", "").unwrap_err().kind, + dbg!(subst(s_t("a die"), "_colour", "")).unwrap_err().kind, SEK::MissingToken(c) if c == "_colour", }} assert!{matches!{ - subst(s_t("a _colour _colour die"), "_colour", "").unwrap_err().kind, + dbg!(subst(s_t("a _colour _colour die"), "_colour", "")).unwrap_err().kind, SEK::RepeatedToken(c) if c == "_colour", }} @@ -1224,11 +1224,12 @@ fn test_subst_mf2() { .unwrap().finish().unwrap(), "a die"); assert!{matches!{ - subst(s_t("a die"), "_colour", "").unwrap_err().kind, + dbg!(subst(s_t("a die"), "_colour", "")).unwrap_err().kind, SEK::MissingToken(c) if c == "_colour", }} assert!{matches!{ - subst(s_t("a ${colour} ${colour} die"), "_colour", "").unwrap_err().kind, + dbg!(subst(s_t("a ${colour} ${colour} die"), "_colour", "")) + .unwrap_err().kind, SEK::RepeatedToken(c) if c == "_colour", }}