From cbcd7c764802e2db81c5adf296cc00ca8190ef29 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 28 May 2024 11:49:33 -0500 Subject: [PATCH 1/4] chore: Upgrade to snapbox 0.5.14 --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c309c0b2..964df006 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1718,9 +1718,9 @@ dependencies = [ [[package]] name = "snapbox" -version = "0.5.9" +version = "0.5.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ac441e1ecf678f68423d47f376d53fabce1afba92c8f68e31508eb27df8562a" +checksum = "f37d101fcafc8e73748fd8a1b7048f5979f93d372fd17027d7724c1643bc379b" dependencies = [ "anstream", "anstyle", @@ -1740,9 +1740,9 @@ dependencies = [ [[package]] name = "snapbox-macros" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c4b838b05d15ab22754068cb73500b2f3b07bf09d310e15b27f88160f1de40" +checksum = "b1f4c14672714436c09254801c934b203196a51182a5107fb76591c7cc56424d" dependencies = [ "anstream", ] diff --git a/Cargo.toml b/Cargo.toml index a05b81f6..f62a81d0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -114,7 +114,7 @@ chrono = "0.4.38" [dev-dependencies] trycmd = "0.15" -snapbox = { version = "0.5.9", features = ["diff"] } +snapbox = { version = "0.5.14", features = ["diff"] } [features] default = ["syntax-highlight", "sass", "serve", "html-minifier"] From 9b9358d6e97e5092e047883fc952c8e3d229b691 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 28 May 2024 11:50:59 -0500 Subject: [PATCH 2/4] refactor: Resolve deprecations --- src/syntax_highlight.rs | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/syntax_highlight.rs b/src/syntax_highlight.rs index 7087632b..b2ed57bc 100644 --- a/src/syntax_highlight.rs +++ b/src/syntax_highlight.rs @@ -218,6 +218,10 @@ pub fn decorate_markdown<'a>( mod test_syntsx { use super::*; + use snapbox::assert_data_eq; + use snapbox::prelude::*; + use snapbox::str; + const CODE_BLOCK: &str = "mod test { fn hello(arg: int) -> bool { \ @@ -243,7 +247,7 @@ mod test_syntsx { .unwrap(); let output = template.render(&liquid::Object::new()); let expected = - snapbox::str!["
\n\
+        str!["
\n\
          mod \
          test {\n\
                  \
@@ -257,7 +261,7 @@ mod test_syntsx {
              }\n\
              
\n"]; - snapbox::assert_eq(expected, output.unwrap()); + assert_data_eq!(output.unwrap(), expected.raw()); } #[test] @@ -277,7 +281,7 @@ mod test_syntsx { decorate_markdown(parser, syntax, Some("base16-ocean.dark")).unwrap(), ); let expected = - snapbox::str!["
\n\
+        str!["
\n\
          mod \
          test {\n\
                  \
@@ -292,7 +296,7 @@ mod test_syntsx {
              \n\
          
\n"]; - snapbox::assert_eq(expected, &buf); + assert_data_eq!(&buf, expected.raw()); } } @@ -301,6 +305,10 @@ mod test_syntsx { mod test_raw { use super::*; + use snapbox::assert_data_eq; + use snapbox::prelude::*; + use snapbox::str; + const CODE_BLOCK: &str = "mod test { fn hello(arg: int) -> bool { \ @@ -325,7 +333,7 @@ mod test_raw { )) .unwrap(); let output = template.render(&liquid::Object::new()); - let expected = snapbox::str![ + let expected = str![ r#"
mod test {
         fn hello(arg: int) -> bool {
             true
@@ -335,7 +343,7 @@ mod test_raw {
 "#
         ];
 
-        snapbox::assert_eq(expected, output.unwrap());
+        assert_data_eq!(output.unwrap(), expected.raw());
     }
 
     #[test]
@@ -354,7 +362,7 @@ mod test_raw {
             &mut buf,
             decorate_markdown(parser, syntax, Some("base16-ocean.dark")).unwrap(),
         );
-        let expected = snapbox::str![
+        let expected = str![
             r#"
mod test {
         fn hello(arg: int) -> bool {
             true
@@ -365,6 +373,6 @@ mod test_raw {
 "#
         ];
 
-        snapbox::assert_eq(expected, buf);
+        assert_data_eq!(&buf, expected.raw());
     }
 }

From 299e3cd6551b788c7126b3b78e89cd8f8677f319 Mon Sep 17 00:00:00 2001
From: Ed Page 
Date: Tue, 28 May 2024 11:52:03 -0500
Subject: [PATCH 3/4] chore: Update to snapbox 0.6

---
 Cargo.lock              | 17 +++++++++--
 Cargo.toml              |  2 +-
 src/syntax_highlight.rs | 66 ++++++++++++++++++-----------------------
 3 files changed, 45 insertions(+), 40 deletions(-)

diff --git a/Cargo.lock b/Cargo.lock
index 964df006..6a60c9d4 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -345,7 +345,7 @@ dependencies = [
  "serde_json",
  "serde_yaml",
  "sitemap",
- "snapbox",
+ "snapbox 0.6.5",
  "tempfile",
  "time",
  "toml",
@@ -1738,6 +1738,19 @@ dependencies = [
  "windows-sys 0.52.0",
 ]
 
+[[package]]
+name = "snapbox"
+version = "0.6.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9ad8c7be18cc9ec7f4d7948ad6b9df0e04fc649663e3c0ed59f304ed17ca69e9"
+dependencies = [
+ "anstream",
+ "anstyle",
+ "normalize-line-endings",
+ "similar",
+ "snapbox-macros",
+]
+
 [[package]]
 name = "snapbox-macros"
 version = "0.3.9"
@@ -1969,7 +1982,7 @@ dependencies = [
  "rayon",
  "serde",
  "shlex",
- "snapbox",
+ "snapbox 0.5.14",
  "toml_edit",
 ]
 
diff --git a/Cargo.toml b/Cargo.toml
index f62a81d0..b9fa8a7c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -114,7 +114,7 @@ chrono = "0.4.38"
 
 [dev-dependencies]
 trycmd = "0.15"
-snapbox = { version = "0.5.14", features = ["diff"] }
+snapbox = { version = "0.6.5", features = ["diff"] }
 
 [features]
 default = ["syntax-highlight", "sass", "serve", "html-minifier"]
diff --git a/src/syntax_highlight.rs b/src/syntax_highlight.rs
index b2ed57bc..ae6276d0 100644
--- a/src/syntax_highlight.rs
+++ b/src/syntax_highlight.rs
@@ -246,20 +246,16 @@ mod test_syntsx {
             ))
             .unwrap();
         let output = template.render(&liquid::Object::new());
-        let expected =
-        str!["
\n\
-         mod \
-         test {\n\
-                 \
-         fn \
-         hello(\
-         arg: int) -> \
-         bool {\n\
-                     \
-         true\n\
-                 }\n\
-             }\n\
-             
\n"]; + let expected = str![[r#" +
+mod test {
+        fn hello(arg: int) -> bool {
+            true
+        }
+    }
+    
+ +"#]]; assert_data_eq!(output.unwrap(), expected.raw()); } @@ -280,21 +276,17 @@ mod test_syntsx { &mut buf, decorate_markdown(parser, syntax, Some("base16-ocean.dark")).unwrap(), ); - let expected = - str!["
\n\
-         mod \
-         test {\n\
-                 \
-         fn \
-         hello(\
-         arg: int) -> \
-         bool {\n\
-                     \
-         true\n\
-                 }\n\
-             }\n\
-             \n\
-         
\n"]; + let expected = str![[r#" +
+mod test {
+        fn hello(arg: int) -> bool {
+            true
+        }
+    }
+    
+
+ +"#]]; assert_data_eq!(&buf, expected.raw()); } @@ -333,15 +325,15 @@ mod test_raw { )) .unwrap(); let output = template.render(&liquid::Object::new()); - let expected = str![ - r#"
mod test {
+        let expected = str![[r#"
+
mod test {
         fn hello(arg: int) -> bool {
             true
         }
     }
 
-"# - ]; + +"#]]; assert_data_eq!(output.unwrap(), expected.raw()); } @@ -362,16 +354,16 @@ mod test_raw { &mut buf, decorate_markdown(parser, syntax, Some("base16-ocean.dark")).unwrap(), ); - let expected = str![ - r#"
mod test {
+        let expected = str![[r#"
+
mod test {
         fn hello(arg: int) -> bool {
             true
         }
     }
 
 
-"# - ]; + +"#]]; assert_data_eq!(&buf, expected.raw()); } From a3a9061d82a91117575e75cbe52f63d558c7eb59 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 28 May 2024 11:55:24 -0500 Subject: [PATCH 4/4] chore: Update trycmd --- Cargo.lock | 89 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 55 insertions(+), 34 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6a60c9d4..9c700e43 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -135,6 +135,17 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "automod" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edf3ee19dbc0a46d740f6f0926bde8c50f02bdbc7b536842da28f6ac56513a8b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.58", +] + [[package]] name = "backtrace" version = "0.3.67" @@ -294,7 +305,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.58", ] [[package]] @@ -345,7 +356,7 @@ dependencies = [ "serde_json", "serde_yaml", "sitemap", - "snapbox 0.6.5", + "snapbox", "tempfile", "time", "toml", @@ -641,7 +652,7 @@ dependencies = [ "num-traits", "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.58", ] [[package]] @@ -1148,7 +1159,7 @@ checksum = "2438da425fd380eb2719a2a5880149697eea32a160e83b63e7848c1bee300406" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.58", ] [[package]] @@ -1407,7 +1418,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.58", ] [[package]] @@ -1472,9 +1483,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.28" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -1645,7 +1656,7 @@ checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.58", ] [[package]] @@ -1718,9 +1729,9 @@ dependencies = [ [[package]] name = "snapbox" -version = "0.5.14" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f37d101fcafc8e73748fd8a1b7048f5979f93d372fd17027d7724c1643bc379b" +checksum = "9ad8c7be18cc9ec7f4d7948ad6b9df0e04fc649663e3c0ed59f304ed17ca69e9" dependencies = [ "anstream", "anstyle", @@ -1738,19 +1749,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "snapbox" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ad8c7be18cc9ec7f4d7948ad6b9df0e04fc649663e3c0ed59f304ed17ca69e9" -dependencies = [ - "anstream", - "anstyle", - "normalize-line-endings", - "similar", - "snapbox-macros", -] - [[package]] name = "snapbox-macros" version = "0.3.9" @@ -1800,9 +1798,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.18" +version = "2.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" +checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687" dependencies = [ "proc-macro2", "quote", @@ -1869,7 +1867,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.58", ] [[package]] @@ -1945,7 +1943,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit", + "toml_edit 0.22.9", ] [[package]] @@ -1957,6 +1955,19 @@ dependencies = [ "serde", ] +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.0.0", + "serde", + "serde_spanned", + "toml_datetime", + "winnow 0.5.40", +] + [[package]] name = "toml_edit" version = "0.22.9" @@ -1967,23 +1978,24 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.6.1", ] [[package]] name = "trycmd" -version = "0.15.0" +version = "0.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "464edb3603a81a50b4c8f47b11dfade69ef48ffdc0af2f8b194ad87cbda75317" +checksum = "8186bd128bd25457be9eea6854abe01254849cb68d752f3c760eee8e068382a7" dependencies = [ + "automod", "glob", "humantime", "humantime-serde", "rayon", "serde", "shlex", - "snapbox 0.5.14", - "toml_edit", + "snapbox", + "toml_edit 0.19.15", ] [[package]] @@ -2124,7 +2136,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.58", "wasm-bindgen-shared", ] @@ -2146,7 +2158,7 @@ checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.58", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2395,6 +2407,15 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +[[package]] +name = "winnow" +version = "0.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] + [[package]] name = "winnow" version = "0.6.1"