Make pretty-expanded-hygiene a ui test

`normalize-stdout-test` removes the need for Make, and it can be updated
with `--bless` this way
This commit is contained in:
Matthew Jasper 2019-07-15 22:26:45 +01:00
parent 03178f31c4
commit a4a7bb9a3f
3 changed files with 12 additions and 21 deletions

View file

@ -1,21 +0,0 @@
-include ../tools.mk
REPLACEMENT := s/[0-9][0-9]*\#[0-9][0-9]*/$(shell date)/g
all:
$(RUSTC) -o $(TMPDIR)/input.out -Z unstable-options \
--pretty expanded,hygiene input.rs
# the name/ctxt numbers are very internals-dependent and thus
# change relatively frequently, and testing for their exact values
# them will fail annoyingly, so we just check their positions
# (using a non-constant replacement like this will make it less
# likely the compiler matches whatever other dummy value we
# choose).
#
# (These need to be out-of-place because OSX/BSD & GNU sed
# differ.)
sed "$(REPLACEMENT)" input.pp.rs > $(TMPDIR)/input.pp.rs
sed "$(REPLACEMENT)" $(TMPDIR)/input.out > $(TMPDIR)/input.out.replaced
diff -u $(TMPDIR)/input.out.replaced $(TMPDIR)/input.pp.rs

View file

@ -1,3 +1,9 @@
// check-pass
// compile-flags: -Zunpretty=expanded,hygiene
// Don't break whenever Symbol numbering changes
// normalize-stdout-test "\d+#" -> "0#"
// minimal junk
#![feature(no_core)]
#![no_core]

View file

@ -1,3 +1,9 @@
// check-pass
// compile-flags: -Zunpretty=expanded,hygiene
// Don't break whenever Symbol numbering changes
// normalize-stdout-test "\d+#" -> "0#"
// minimal junk
#![feature /* 0#0 */(no_core)]
#![no_core /* 0#0 */]