From a1fcbe5df11dce5c2e9696cae289b864d9ef1547 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Sun, 9 Jun 2019 10:29:33 +0200 Subject: [PATCH] Fix tests Signed-off-by: Igor Gnatenko --- ...-for-new-proc-macro2-escape-behavior.patch | 43 +++++++++++++++++++ rust-quote.spec | 2 + 2 files changed, 45 insertions(+) create mode 100644 0001-Update-tests-for-new-proc-macro2-escape-behavior.patch diff --git a/0001-Update-tests-for-new-proc-macro2-escape-behavior.patch b/0001-Update-tests-for-new-proc-macro2-escape-behavior.patch new file mode 100644 index 0000000..cbb0b22 --- /dev/null +++ b/0001-Update-tests-for-new-proc-macro2-escape-behavior.patch @@ -0,0 +1,43 @@ +From b3a3d76815b6f892a86c15da39a3019608290719 Mon Sep 17 00:00:00 2001 +From: David Tolnay +Date: Tue, 23 Apr 2019 21:31:54 -0700 +Subject: [PATCH] Update tests for new proc-macro2 escape behavior + +--- + tests/test.rs | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/tests/test.rs b/tests/test.rs +index f832da5..85562bf 100644 +--- a/tests/test.rs ++++ b/tests/test.rs +@@ -166,7 +166,7 @@ fn test_char() { + let tokens = quote! { + #zero #pound #quote #apost #newline #heart + }; +- let expected = "'\\u{0}' '#' '\\\"' '\\'' '\\n' '\\u{2764}'"; ++ let expected = "'\\u{0}' '#' '\"' '\\'' '\\n' '\\u{2764}'"; + assert_eq!(expected, tokens.to_string()); + } + +@@ -174,7 +174,7 @@ fn test_char() { + fn test_str() { + let s = "\0 a 'b \" c"; + let tokens = quote!(#s); +- let expected = "\"\\u{0} a \\'b \\\" c\""; ++ let expected = "\"\\u{0} a 'b \\\" c\""; + assert_eq!(expected, tokens.to_string()); + } + +@@ -182,7 +182,7 @@ fn test_str() { + fn test_string() { + let s = "\0 a 'b \" c".to_string(); + let tokens = quote!(#s); +- let expected = "\"\\u{0} a \\'b \\\" c\""; ++ let expected = "\"\\u{0} a 'b \\\" c\""; + assert_eq!(expected, tokens.to_string()); + } + +-- +2.22.0.rc3 + diff --git a/rust-quote.spec b/rust-quote.spec index bc2a957..92eab17 100644 --- a/rust-quote.spec +++ b/rust-quote.spec @@ -13,6 +13,8 @@ Summary: Quasi-quoting macro quote!(...) License: MIT or ASL 2.0 URL: https://crates.io/crates/quote Source: %{crates_source} +# https://github.com/dtolnay/quote/commit/b3a3d76815b6f892a86c15da39a3019608290719 +Patch0001: 0001-Update-tests-for-new-proc-macro2-escape-behavior.patch ExclusiveArch: %{rust_arches} %if %{__cargo_skip_build}