aboutsummaryrefslogtreecommitdiffstats
path: root/build.rs
diff options
context:
space:
mode:
Diffstat (limited to 'build.rs')
-rw-r--r--build.rs13
1 files changed, 5 insertions, 8 deletions
diff --git a/build.rs b/build.rs
index 78382fe..a4947f5 100644
--- a/build.rs
+++ b/build.rs
@@ -11,7 +11,6 @@ async fn main() {
async fn commonmark() {
let url = "https://raw.githubusercontent.com/commonmark/commonmark-spec/0.30/spec.txt";
let data_url = "commonmark-data.txt";
- #[allow(unused_variables)]
let code_url = "tests/commonmark.rs";
let value = if let Ok(value) = fs::read_to_string(data_url) {
@@ -28,7 +27,7 @@ async fn commonmark() {
let re_heading_prefix = Regex::new(r"#{1,6} ").unwrap();
let re_in_out = Regex::new(r"\n\.(?:\n|$)").unwrap();
let mut current_heading: Option<String> = None;
- let mut case_index = 0;
+ let mut number = 1;
let value = Regex::new(r"<!-- END TESTS -->[\s\S]*")
.unwrap()
@@ -54,20 +53,19 @@ async fn commonmark() {
format!("{}\n", parts[1])
};
- let test = format!(" assert_eq!(\n micromark_with_options(r###\"{}\"###, DANGER),\n r###\"{}\"###,\n r###\"{} ({})\"###\n);", input, output, section, case_index);
+ let test = format!(" assert_eq!(\n micromark_with_options(r###\"{}\"###, DANGER),\n r###\"{}\"###,\n r###\"{} ({})\"###\n);", input, output, section, number);
cases.push(test);
- case_index += 1;
+ number += 1;
}
}
- #[allow(unused_variables)]
let doc = format!(
"//! CommonMark test suite.
// > 👉 **Important**: this module is generated by `build.rs`.
-// > It is generate from the latest Unicode data.
+// > It is generate from the latest CommonMark website.
extern crate micromark;
use micromark::{{micromark_with_options, Options}};
@@ -87,8 +85,7 @@ fn commonmark() {{
cases.join("\n\n")
);
- // To do: enable when CM is completely fixed.
- // fs::write(code_url, doc).unwrap();
+ fs::write(code_url, doc).unwrap();
}
async fn punctuation() {