Skip to content

Commit

Permalink
macro-commas test cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ExpHP committed Feb 14, 2018
1 parent b7c6dc6 commit 9205f3d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
6 changes: 3 additions & 3 deletions src/test/run-pass/macro-comma-behavior.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ fn debug_assert_1arg() {
// make sure we don't accidentally forward to `write!("text")`
#[cfg(std)]
#[test]
fn writeln_2arg() {
fn writeln_1arg() {
use fmt::Write;

let mut s = String::new();
writeln!(&mut s, "hi",).unwrap();
assert_eq!(&s, "hi\n");
writeln!(&mut s,).unwrap();
assert_eq!(&s, "\n");
}

// A number of format_args-like macros have special-case treatment
Expand Down
18 changes: 2 additions & 16 deletions src/test/run-pass/macro-comma-support.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,10 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// This is a comprehensive test of invocations with and without
// This is meant to be a comprehensive test of invocations with/without
// trailing commas (or other, similar optionally-trailing separators).
// Every macro is accounted for, even those not tested in this file.
// (There will be a note indicating why).
//
// The expectation is for this to be updated as new macros are added,
// or as functionality is added to existing macros.
//
// (FIXME: (please discuss in PR) is the above expectation reasonable?)

// std and core are both tested because they may contain separate
// implementations for some macro_rules! macros as an implementation
Expand Down Expand Up @@ -245,16 +240,7 @@ fn println() {
println!("hello {}", "world",);
}

// FIXME: select! (please discuss in PR)
//
// Test cases for select! are obnoxiously large, see here:
//
// https://github.com/ExpHP/rust-macro-comma-test/blob/0062e75e01ab/src/main.rs#L190-L250
//
// and due to other usability issues described there, it is unclear to me that it is
// going anywhere in its current state. This is a job far too big for a macro_rules! macro,
// and for as long as it exists in this form it will have many many problems far worse than
// just lack of trailing comma support.
// select! is too troublesome and unlikely to be stabilized

// stringify! is N/A

Expand Down

0 comments on commit 9205f3d

Please sign in to comment.