diff --git a/build.rs b/build.rs index 814f344e0..3a87927f8 100644 --- a/build.rs +++ b/build.rs @@ -54,6 +54,8 @@ fn generate_tests_from_spec() { let mut spec_rs = File::create(&rs_test_file) .expect(&format!("Could not create {:?}", rs_test_file)); + let spec_name = file_path.file_stem().unwrap().to_str().unwrap(); + let spec = Spec::new(&raw_spec); let mut n_tests = 0; @@ -67,7 +69,7 @@ fn generate_tests_from_spec() { r###" #[test] - fn spec_test_{i}() {{ + fn {}_test_{i}_() {{ let original = r##"{original}"##; let expected = r##"{expected}"##; @@ -84,6 +86,7 @@ fn generate_tests_from_spec() { assert_eq!(expected, s); }}"###, + spec_name, i=i+1, original=testcase.original, expected=testcase.expected diff --git a/tests/footnotes.rs b/tests/footnotes.rs index e1b1903f3..2100d3fea 100644 --- a/tests/footnotes.rs +++ b/tests/footnotes.rs @@ -5,7 +5,7 @@ extern crate pulldown_cmark; #[test] - fn spec_test_1() { + fn footnotes_test_1_() { let original = r##"Lorem ipsum.[^a] [^a]: Cool. @@ -31,7 +31,7 @@ extern crate pulldown_cmark; } #[test] - fn spec_test_2() { + fn footnotes_test_2_() { let original = r##"> This is the song that never ends.\ > Yes it goes on and on my friends.[^lambchops] > @@ -61,7 +61,7 @@ Yes it goes on and on my friends. He's also really stupid. [^why] > > [^why]: Because your mamma! @@ -181,7 +181,7 @@ As such, we can guarantee that the non-childish forms of entertainment are proba } #[test] - fn spec_test_7() { + fn footnotes_test_7_() { let original = r##"Nested footnotes are considered poor style. [^a] [^xkcd] [^a]: This does not mean that footnotes cannot reference each other. [^b] @@ -226,7 +226,7 @@ As such, we can guarantee that the non-childish forms of entertainment are proba } #[test] - fn spec_test_8() { + fn footnotes_test_8_() { let original = r##"[^Doh] Ray Me Fa So La Te Do! [^1] [^Doh]: I know. Wrong Doe. And it won't render right. diff --git a/tests/spec.rs b/tests/spec.rs index 0af21284c..4f368a55f 100644 --- a/tests/spec.rs +++ b/tests/spec.rs @@ -5,7 +5,7 @@ extern crate pulldown_cmark; #[test] - fn spec_test_1() { + fn spec_test_1_() { let original = r##" foo baz bim "##; let expected = r##"
foo	baz		bim
@@ -27,7 +27,7 @@ extern crate pulldown_cmark;
     }
 
     #[test]
-    fn spec_test_2() {
+    fn spec_test_2_() {
         let original = r##"  	foo	baz		bim
 "##;
         let expected = r##"
foo	baz		bim
@@ -49,7 +49,7 @@ extern crate pulldown_cmark;
     }
 
     #[test]
-    fn spec_test_3() {
+    fn spec_test_3_() {
         let original = r##"    a	a
     ὐ	a
 "##;
@@ -73,7 +73,7 @@ extern crate pulldown_cmark;
     }
 
     #[test]
-    fn spec_test_4() {
+    fn spec_test_4_() {
         let original = r##"  - foo
 
 	bar
@@ -101,7 +101,7 @@ extern crate pulldown_cmark;
     }
 
     #[test]
-    fn spec_test_5() {
+    fn spec_test_5_() {
         let original = r##"- foo
 
 		bar
@@ -130,7 +130,7 @@ extern crate pulldown_cmark;
     }
 
     #[test]
-    fn spec_test_6() {
+    fn spec_test_6_() {
         let original = r##">		foo
 "##;
         let expected = r##"
@@ -154,7 +154,7 @@ extern crate pulldown_cmark; } #[test] - fn spec_test_7() { + fn spec_test_7_() { let original = r##"- foo "##; let expected = r##"