annotate tests/test-check-rust-format.t @ 47067:ea563187ee7c stable

tests: change the fixer commands to use the buffer attribute on stdio objects Otherwise `\r` was getting injected into the fixed lines and throwing off the commit hashes on Windows when the fixer is invoked with py3. Differential Revision: https://phab.mercurial-scm.org/D10637
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 02 May 2021 16:56:20 -0400
parents d42809b6b10f
children 9ebc10ad4a04
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
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"/..
45987
d42809b6b10f rust-format: pin the formatted to a specific nightly version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44732
diff changeset
6 $ RUSTFMT=$(rustup which --toolchain nightly-2020-10-04 rustfmt)
43819
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