Skip to content

Commit 46f4b5d

Browse files
committed
add a tidy test
1 parent 63b1db0 commit 46f4b5d

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

src/tools/tidy/src/alphabetical/tests.rs

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,3 +337,62 @@ fn test_numeric_bad() {
337337
";
338338
bad(lines, "bad:3: line not in alphabetical order");
339339
}
340+
341+
#[test]
342+
fn multiline() {
343+
let lines = "\
344+
tidy-alphabetical-start
345+
(b,
346+
a);
347+
(
348+
b,
349+
a
350+
)
351+
tidy-alphabetical-end
352+
";
353+
good(lines);
354+
355+
let lines = "\
356+
tidy-alphabetical-start
357+
(
358+
b,
359+
a
360+
)
361+
(b,
362+
a);
363+
tidy-alphabetical-end
364+
";
365+
good(lines);
366+
367+
let lines = "\
368+
tidy-alphabetical-start
369+
(c,
370+
a);
371+
(
372+
b,
373+
a
374+
)
375+
tidy-alphabetical-end
376+
";
377+
bad(lines, "bad:5: line not in alphabetical order");
378+
379+
let lines = "\
380+
tidy-alphabetical-start
381+
(
382+
c,
383+
a
384+
)
385+
(b,
386+
a);
387+
tidy-alphabetical-end
388+
";
389+
bad(lines, "bad:6: line not in alphabetical order");
390+
391+
let lines = "\
392+
force_unwind_tables: Option<bool> = (None, parse_opt_bool, [TRACKED],
393+
'force use of unwind tables'),
394+
incremental: Option<String> = (None, parse_opt_string, [UNTRACKED],
395+
'enable incremental compilation'),
396+
";
397+
good(lines);
398+
}

0 commit comments

Comments
 (0)