From b72b93db11d9fb308acf8ed0182316c9c164b52e Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 15 May 2022 15:36:49 +0100 Subject: [PATCH] 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 --- src/shapelib.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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", }} -- 2.30.2