tests/test-check-rust-format.t
author Yuya Nishihara <yuya@tcha.org>
Fri, 17 Apr 2020 19:35:18 +0900
changeset 44732 f44a7d8660ea
parent 43819 e8a3bbffdc7d
child 45987 d42809b6b10f
permissions -rw-r--r--
test-check-rust-format: specify --edition=2018 rustfmt doesn't read Cargo.toml unless it's executed by cargo. https://github.com/rust-lang/rustfmt#rusts-editions
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
43819
e8a3bbffdc7d tests: add test for Rust formatting
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     1
#require rustfmt test-repo
e8a3bbffdc7d tests: add test for Rust formatting
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     2
e8a3bbffdc7d tests: add test for Rust formatting
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     3
  $ . "$TESTDIR/helpers-testrepo.sh"
e8a3bbffdc7d tests: add test for Rust formatting
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     4
e8a3bbffdc7d tests: add test for Rust formatting
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     5
  $ cd "$TESTDIR"/..
e8a3bbffdc7d tests: add test for Rust formatting
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     6
  $ RUSTFMT=$(rustup which --toolchain nightly rustfmt)
e8a3bbffdc7d tests: add test for Rust formatting
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     7
  $ for f in `testrepohg files 'glob:**/*.rs'` ; do
44732
f44a7d8660ea test-check-rust-format: specify --edition=2018
Yuya Nishihara <yuya@tcha.org>
parents: 43819
diff changeset
     8
  >   $RUSTFMT --check --edition=2018 --unstable-features --color=never $f
43819
e8a3bbffdc7d tests: add test for Rust formatting
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     9
  > done