chiark / gitweb /
subst test: Add many dbg calls
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 15 May 2022 14:36:49 +0000 (15:36 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 15 May 2022 19:24:15 +0000 (20:24 +0100)
It turns out that I can make these fail and having it debug is useful.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/shapelib.rs

index 6bf29ebfe99f15f89535da582015245dd775a5fb..bb2804a2133c41adabba8b9a1053ff5f9cc17f3a 100644 (file)
@@ -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",
   }}