blob: 51d938e3b4ee15b6552f9e589f6b6c2c8ba58335 [file] [log] [blame] [edit]
set -e
mkdir test
INPUT="load(':foo.bzl', 'foo'); foo(tags=['b', 'a'],srcs=['d', 'c'])" # formatted differently in build and bzl modes
echo -e "$INPUT" > test/BUILD
echo -e "$INPUT" > test/test.bzl
$1 --type=auto test/*
$2 test/test.bzl > test/test.bzl.out
cat > test/BUILD.golden <<EOF
load(":foo.bzl", "foo")
foo(
srcs = [
"c",
"d",
],
tags = [
"a",
"b",
],
)
EOF
cat > test/test.bzl.golden <<EOF
load(":foo.bzl", "foo")
foo(tags = ["b", "a"], srcs = ["d", "c"])
EOF
diff test/BUILD test/BUILD.golden
diff test/test.bzl test/test.bzl.golden
diff test/test.bzl.out test/test.bzl.golden