Skip to content

Commit f75d659

Browse files
committed
Consistently use comment_prefix in example code.
1 parent a759449 commit f75d659

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ fn main() {
2727
.test_dir("examples/rust_lang_tester/lang_tests")
2828
// Only use files named `*.rs` as test files.
2929
.test_file_filter(|p| p.extension().unwrap().to_str().unwrap() == "rs")
30+
// Treat lines beginning with "#" as comments.
31+
.comment_prefix("#")
3032
// Extract the first sequence of commented line(s) as the tests.
3133
.test_extract(|p| {
3234
read_to_string(p)

examples/rust_lang_tester/run_tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ fn main() {
1717
let tempdir = TempDir::new().unwrap();
1818
LangTester::new()
1919
.test_dir("examples/rust_lang_tester/lang_tests")
20-
// Treat top-level lines beginning with "#" as comments.
21-
.comment_prefix("#")
2220
// Only use files named `*.rs` as test files.
2321
.test_path_filter(|p| p.extension().and_then(|x| x.to_str()) == Some("rs"))
22+
// Treat top-level lines beginning with "#" as comments.
23+
.comment_prefix("#")
2424
// Extract the first sequence of commented line(s) as the tests.
2525
.test_extract(|p| {
2626
read_to_string(p)

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
//! .test_dir("examples/rust_lang_tester/lang_tests")
2525
//! // Only use files named `*.rs` as test files.
2626
//! .test_path_filter(|p| p.extension().and_then(|x| x.to_str()) == Some("rs"))
27+
//! // Treat lines beginning with "#" as comments.
28+
//! .comment_prefix("#")
2729
//! // Extract the first sequence of commented line(s) as the tests.
2830
//! .test_extract(|p| {
2931
//! read_to_string(p)

0 commit comments

Comments
 (0)