aboutsummaryrefslogtreecommitdiff
path: root/tools/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tools/src/lib.rs')
-rw-r--r--tools/src/lib.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/src/lib.rs b/tools/src/lib.rs
index 1b7ef3ca9..7a0de3e3c 100644
--- a/tools/src/lib.rs
+++ b/tools/src/lib.rs
@@ -5,7 +5,6 @@ use itertools::Itertools;
5 5
6#[derive(Debug, Eq)] 6#[derive(Debug, Eq)]
7pub struct Test { 7pub struct Test {
8 pub start_line: usize,
9 pub name: String, 8 pub name: String,
10 pub text: String, 9 pub text: String,
11} 10}
@@ -22,7 +21,7 @@ impl hash::Hash for Test {
22 } 21 }
23} 22}
24 23
25pub fn collect_tests(s: &str) -> Vec<Test> { 24pub fn collect_tests(s: &str) -> Vec<(usize, Test)> {
26 let mut res = vec![]; 25 let mut res = vec![];
27 let prefix = "// "; 26 let prefix = "// ";
28 let comment_blocks = s 27 let comment_blocks = s
@@ -52,7 +51,7 @@ pub fn collect_tests(s: &str) -> Vec<Test> {
52 "\n" 51 "\n"
53 ); 52 );
54 assert!(!text.trim().is_empty() && text.ends_with("\n")); 53 assert!(!text.trim().is_empty() && text.ends_with("\n"));
55 res.push(Test { start_line, name, text }) 54 res.push((start_line, Test {name, text }))
56 } 55 }
57 res 56 res
58} 57}