swc/ecmascript/minifier/scripts/sort.sh
강동윤 d20c1d3089
feat(es/minifier): Implement more rules (#1717)
swc_ecma_minifier:
 - Implement `global-defs` pass.
 - Implement `properties` pass partially.
2021-05-21 15:57:17 +09:00

15 lines
525 B
Bash
Executable File

#!/usr/bin/env bash
set -eu
# Fix sorting differences between Linux and Mac
export LC_ALL=C
cat tests/golden.txt | awk NF | sort | uniq | awk '{$1=$1};1' | uniq | sort > tests/golden_sorted.txt
mv tests/golden_sorted.txt tests/golden.txt
cat tests/ignored.txt | awk NF | sort | uniq | awk '{$1=$1};1' | uniq | sort > tests/ignored_sorted.txt
mv tests/ignored_sorted.txt tests/ignored.txt
# Don't mark ignored test as golden
comm -23 tests/golden.txt tests/ignored.txt > tests/nodup.txt
mv tests/nodup.txt tests/golden.txt