From 161e0decf78a0f2751368eab168452b4234ee2a1 Mon Sep 17 00:00:00 2001 From: romainmenke Date: Sun, 21 Nov 2021 23:00:27 +0100 Subject: [PATCH 1/3] test cli without newlines --- .gitattributes | 1 + .../test/cli/.editorconfig | 5 ++ .../test/cli/basic.color.expect.css | 7 +-- .../postcss-base-plugin/test/cli/basic.css | 4 +- .../test/cli/basic.expect.css | 7 +-- .../test/cli/basic.external-map.expect.css | 5 +- .../cli/basic.external-map.expect.css.map | 2 +- .../test/cli/basic.no-map.expect.css | 4 +- .../test/cli/basic.replace.css | 7 +-- .../test/cli/basic.replace.expect.css | 7 +-- .../test/cli/basic.stdin.expect.css | 7 +-- .../postcss-base-plugin/test/cli/out/a.css | 5 +- .../test/cli/out/a.css.map | 2 +- .../test/cli/out/a.expect.css | 5 +- .../test/cli/out/a.expect.css.map | 2 +- .../postcss-base-plugin/test/cli/out/b.css | 5 +- .../test/cli/out/b.css.map | 2 +- .../test/cli/out/b.expect.css | 5 +- .../test/cli/out/b.expect.css.map | 2 +- .../test/cli/out/concatenated.css | 7 +-- .../test/cli/out/concatenated.expect.css | 7 +-- .../postcss-base-plugin/test/cli/src/a.css | 4 +- .../postcss-base-plugin/test/cli/src/b.css | 4 +- plugins/postcss-base-plugin/test/cli/test.sh | 47 ++++--------------- 24 files changed, 41 insertions(+), 112 deletions(-) create mode 100644 .gitattributes create mode 100644 plugins/postcss-base-plugin/test/cli/.editorconfig diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..6313b56c5 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf diff --git a/plugins/postcss-base-plugin/test/cli/.editorconfig b/plugins/postcss-base-plugin/test/cli/.editorconfig new file mode 100644 index 000000000..d70510bdf --- /dev/null +++ b/plugins/postcss-base-plugin/test/cli/.editorconfig @@ -0,0 +1,5 @@ +[*.css] +insert_final_newline = false + +[*.css.map] +insert_final_newline = false diff --git a/plugins/postcss-base-plugin/test/cli/basic.color.expect.css b/plugins/postcss-base-plugin/test/cli/basic.color.expect.css index 93f6b5280..f0c396647 100644 --- a/plugins/postcss-base-plugin/test/cli/basic.color.expect.css +++ b/plugins/postcss-base-plugin/test/cli/basic.color.expect.css @@ -1,5 +1,2 @@ -.foo { - color: purple; -} - -/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJhc2ljLmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtDQUNDLGFBQVU7QUFDWCIsImZpbGUiOiJiYXNpYy5jb2xvci5yZXN1bHQuY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLmZvbyB7XG5cdGNvbG9yOiByZWQ7XG59XG4iXX0= */ +.foo { color: purple; } +/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJhc2ljLmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLGFBQVUsRUFBRSIsImZpbGUiOiJiYXNpYy5jb2xvci5yZXN1bHQuY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLmZvbyB7IGNvbG9yOiByZWQ7IH0iXX0= */ diff --git a/plugins/postcss-base-plugin/test/cli/basic.css b/plugins/postcss-base-plugin/test/cli/basic.css index cedf0a6d1..91ec900c0 100644 --- a/plugins/postcss-base-plugin/test/cli/basic.css +++ b/plugins/postcss-base-plugin/test/cli/basic.css @@ -1,3 +1 @@ -.foo { - color: red; -} +.foo { color: red; } \ No newline at end of file diff --git a/plugins/postcss-base-plugin/test/cli/basic.expect.css b/plugins/postcss-base-plugin/test/cli/basic.expect.css index 3f6f0d3a4..57f3fb9fe 100644 --- a/plugins/postcss-base-plugin/test/cli/basic.expect.css +++ b/plugins/postcss-base-plugin/test/cli/basic.expect.css @@ -1,5 +1,2 @@ -.foo { - color: blue; -} - -/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJhc2ljLmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtDQUNDLFdBQVU7QUFDWCIsImZpbGUiOiJiYXNpYy5yZXN1bHQuY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLmZvbyB7XG5cdGNvbG9yOiByZWQ7XG59XG4iXX0= */ +.foo { color: blue; } +/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJhc2ljLmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLFdBQVUsRUFBRSIsImZpbGUiOiJiYXNpYy5yZXN1bHQuY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLmZvbyB7IGNvbG9yOiByZWQ7IH0iXX0= */ diff --git a/plugins/postcss-base-plugin/test/cli/basic.external-map.expect.css b/plugins/postcss-base-plugin/test/cli/basic.external-map.expect.css index b8aaa92b1..62c292276 100644 --- a/plugins/postcss-base-plugin/test/cli/basic.external-map.expect.css +++ b/plugins/postcss-base-plugin/test/cli/basic.external-map.expect.css @@ -1,5 +1,2 @@ -.foo { - color: blue; -} - +.foo { color: blue; } /*# sourceMappingURL=basic.external-map.result.css.map */ \ No newline at end of file diff --git a/plugins/postcss-base-plugin/test/cli/basic.external-map.expect.css.map b/plugins/postcss-base-plugin/test/cli/basic.external-map.expect.css.map index 8f8e733cc..209346075 100644 --- a/plugins/postcss-base-plugin/test/cli/basic.external-map.expect.css.map +++ b/plugins/postcss-base-plugin/test/cli/basic.external-map.expect.css.map @@ -1 +1 @@ -{"version":3,"sources":["../../stdin"],"names":[],"mappings":"AAAA;CACC,WAAU;AACX","file":"basic.external-map.result.css","sourcesContent":[".foo {\n\tcolor: red;\n}\n"]} \ No newline at end of file +{"version":3,"sources":["../../stdin"],"names":[],"mappings":"AAAA,OAAO,WAAU,EAAE","file":"basic.external-map.result.css","sourcesContent":[".foo { color: red; }"]} \ No newline at end of file diff --git a/plugins/postcss-base-plugin/test/cli/basic.no-map.expect.css b/plugins/postcss-base-plugin/test/cli/basic.no-map.expect.css index c47fa33b8..dca92f52d 100644 --- a/plugins/postcss-base-plugin/test/cli/basic.no-map.expect.css +++ b/plugins/postcss-base-plugin/test/cli/basic.no-map.expect.css @@ -1,3 +1 @@ -.foo { - color: blue; -} +.foo { color: blue; } \ No newline at end of file diff --git a/plugins/postcss-base-plugin/test/cli/basic.replace.css b/plugins/postcss-base-plugin/test/cli/basic.replace.css index 49bc11102..7eb73eebb 100644 --- a/plugins/postcss-base-plugin/test/cli/basic.replace.css +++ b/plugins/postcss-base-plugin/test/cli/basic.replace.css @@ -1,5 +1,2 @@ -.foo { - color: blue; -} - -/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJhc2ljLnJlcGxhY2UuY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0NBQ0MsV0FBVTtBQUNYIiwiZmlsZSI6ImJhc2ljLnJlcGxhY2UuY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLmZvbyB7XG5cdGNvbG9yOiByZWQ7XG59XG4iXX0= */ +.foo { color: blue; } +/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJhc2ljLnJlcGxhY2UuY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sV0FBVSxFQUFFIiwiZmlsZSI6ImJhc2ljLnJlcGxhY2UuY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLmZvbyB7IGNvbG9yOiByZWQ7IH0iXX0= */ diff --git a/plugins/postcss-base-plugin/test/cli/basic.replace.expect.css b/plugins/postcss-base-plugin/test/cli/basic.replace.expect.css index 49bc11102..7eb73eebb 100644 --- a/plugins/postcss-base-plugin/test/cli/basic.replace.expect.css +++ b/plugins/postcss-base-plugin/test/cli/basic.replace.expect.css @@ -1,5 +1,2 @@ -.foo { - color: blue; -} - -/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJhc2ljLnJlcGxhY2UuY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0NBQ0MsV0FBVTtBQUNYIiwiZmlsZSI6ImJhc2ljLnJlcGxhY2UuY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLmZvbyB7XG5cdGNvbG9yOiByZWQ7XG59XG4iXX0= */ +.foo { color: blue; } +/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJhc2ljLnJlcGxhY2UuY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sV0FBVSxFQUFFIiwiZmlsZSI6ImJhc2ljLnJlcGxhY2UuY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLmZvbyB7IGNvbG9yOiByZWQ7IH0iXX0= */ diff --git a/plugins/postcss-base-plugin/test/cli/basic.stdin.expect.css b/plugins/postcss-base-plugin/test/cli/basic.stdin.expect.css index 7def14035..87ed91701 100644 --- a/plugins/postcss-base-plugin/test/cli/basic.stdin.expect.css +++ b/plugins/postcss-base-plugin/test/cli/basic.stdin.expect.css @@ -1,5 +1,2 @@ -.foo { - color: blue; -} - -/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0ZGluIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0NBQ0MsV0FBVTtBQUNYIiwiZmlsZSI6InN0ZG91dCIsInNvdXJjZXNDb250ZW50IjpbIi5mb28ge1xuXHRjb2xvcjogcmVkO1xufVxuIl19 */ +.foo { color: blue; } +/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0ZGluIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sV0FBVSxFQUFFIiwiZmlsZSI6InN0ZG91dCIsInNvdXJjZXNDb250ZW50IjpbIi5mb28geyBjb2xvcjogcmVkOyB9Il19 */ diff --git a/plugins/postcss-base-plugin/test/cli/out/a.css b/plugins/postcss-base-plugin/test/cli/out/a.css index 60e2001c0..95953ad4c 100644 --- a/plugins/postcss-base-plugin/test/cli/out/a.css +++ b/plugins/postcss-base-plugin/test/cli/out/a.css @@ -1,5 +1,2 @@ -.foo { - color: blue; -} - +.foo { color: blue; } /*# sourceMappingURL=a.css.map */ \ No newline at end of file diff --git a/plugins/postcss-base-plugin/test/cli/out/a.css.map b/plugins/postcss-base-plugin/test/cli/out/a.css.map index d5c8b6f40..92ec84a81 100644 --- a/plugins/postcss-base-plugin/test/cli/out/a.css.map +++ b/plugins/postcss-base-plugin/test/cli/out/a.css.map @@ -1 +1 @@ -{"version":3,"sources":["../src/a.css"],"names":[],"mappings":"AAAA;CACC,WAAU;AACX","file":"a.css","sourcesContent":[".foo {\n\tcolor: red;\n}\n"]} \ No newline at end of file +{"version":3,"sources":["../src/a.css"],"names":[],"mappings":"AAAA,OAAO,WAAU,EAAE","file":"a.css","sourcesContent":[".foo { color: red; }"]} \ No newline at end of file diff --git a/plugins/postcss-base-plugin/test/cli/out/a.expect.css b/plugins/postcss-base-plugin/test/cli/out/a.expect.css index 60e2001c0..95953ad4c 100644 --- a/plugins/postcss-base-plugin/test/cli/out/a.expect.css +++ b/plugins/postcss-base-plugin/test/cli/out/a.expect.css @@ -1,5 +1,2 @@ -.foo { - color: blue; -} - +.foo { color: blue; } /*# sourceMappingURL=a.css.map */ \ No newline at end of file diff --git a/plugins/postcss-base-plugin/test/cli/out/a.expect.css.map b/plugins/postcss-base-plugin/test/cli/out/a.expect.css.map index d5c8b6f40..92ec84a81 100644 --- a/plugins/postcss-base-plugin/test/cli/out/a.expect.css.map +++ b/plugins/postcss-base-plugin/test/cli/out/a.expect.css.map @@ -1 +1 @@ -{"version":3,"sources":["../src/a.css"],"names":[],"mappings":"AAAA;CACC,WAAU;AACX","file":"a.css","sourcesContent":[".foo {\n\tcolor: red;\n}\n"]} \ No newline at end of file +{"version":3,"sources":["../src/a.css"],"names":[],"mappings":"AAAA,OAAO,WAAU,EAAE","file":"a.css","sourcesContent":[".foo { color: red; }"]} \ No newline at end of file diff --git a/plugins/postcss-base-plugin/test/cli/out/b.css b/plugins/postcss-base-plugin/test/cli/out/b.css index ac091faeb..88991c625 100644 --- a/plugins/postcss-base-plugin/test/cli/out/b.css +++ b/plugins/postcss-base-plugin/test/cli/out/b.css @@ -1,5 +1,2 @@ -.baz { - color: blue; -} - +.baz { color: blue; } /*# sourceMappingURL=b.css.map */ \ No newline at end of file diff --git a/plugins/postcss-base-plugin/test/cli/out/b.css.map b/plugins/postcss-base-plugin/test/cli/out/b.css.map index 0a97ca290..9679cfbd7 100644 --- a/plugins/postcss-base-plugin/test/cli/out/b.css.map +++ b/plugins/postcss-base-plugin/test/cli/out/b.css.map @@ -1 +1 @@ -{"version":3,"sources":["../src/b.css"],"names":[],"mappings":"AAAA;CACC,WAAU;AACX","file":"b.css","sourcesContent":[".baz {\n\tcolor: red;\n}\n"]} \ No newline at end of file +{"version":3,"sources":["../src/b.css"],"names":[],"mappings":"AAAA,OAAO,WAAU,EAAE","file":"b.css","sourcesContent":[".baz { color: red; }"]} \ No newline at end of file diff --git a/plugins/postcss-base-plugin/test/cli/out/b.expect.css b/plugins/postcss-base-plugin/test/cli/out/b.expect.css index ac091faeb..88991c625 100644 --- a/plugins/postcss-base-plugin/test/cli/out/b.expect.css +++ b/plugins/postcss-base-plugin/test/cli/out/b.expect.css @@ -1,5 +1,2 @@ -.baz { - color: blue; -} - +.baz { color: blue; } /*# sourceMappingURL=b.css.map */ \ No newline at end of file diff --git a/plugins/postcss-base-plugin/test/cli/out/b.expect.css.map b/plugins/postcss-base-plugin/test/cli/out/b.expect.css.map index 0a97ca290..9679cfbd7 100644 --- a/plugins/postcss-base-plugin/test/cli/out/b.expect.css.map +++ b/plugins/postcss-base-plugin/test/cli/out/b.expect.css.map @@ -1 +1 @@ -{"version":3,"sources":["../src/b.css"],"names":[],"mappings":"AAAA;CACC,WAAU;AACX","file":"b.css","sourcesContent":[".baz {\n\tcolor: red;\n}\n"]} \ No newline at end of file +{"version":3,"sources":["../src/b.css"],"names":[],"mappings":"AAAA,OAAO,WAAU,EAAE","file":"b.css","sourcesContent":[".baz { color: red; }"]} \ No newline at end of file diff --git a/plugins/postcss-base-plugin/test/cli/out/concatenated.css b/plugins/postcss-base-plugin/test/cli/out/concatenated.css index 80726df77..ded6a1390 100644 --- a/plugins/postcss-base-plugin/test/cli/out/concatenated.css +++ b/plugins/postcss-base-plugin/test/cli/out/concatenated.css @@ -1,6 +1 @@ -.foo { - color: blue; -} -.baz { - color: blue; -} +.foo { color: blue; }.baz { color: blue; } \ No newline at end of file diff --git a/plugins/postcss-base-plugin/test/cli/out/concatenated.expect.css b/plugins/postcss-base-plugin/test/cli/out/concatenated.expect.css index 80726df77..ded6a1390 100644 --- a/plugins/postcss-base-plugin/test/cli/out/concatenated.expect.css +++ b/plugins/postcss-base-plugin/test/cli/out/concatenated.expect.css @@ -1,6 +1 @@ -.foo { - color: blue; -} -.baz { - color: blue; -} +.foo { color: blue; }.baz { color: blue; } \ No newline at end of file diff --git a/plugins/postcss-base-plugin/test/cli/src/a.css b/plugins/postcss-base-plugin/test/cli/src/a.css index cedf0a6d1..91ec900c0 100644 --- a/plugins/postcss-base-plugin/test/cli/src/a.css +++ b/plugins/postcss-base-plugin/test/cli/src/a.css @@ -1,3 +1 @@ -.foo { - color: red; -} +.foo { color: red; } \ No newline at end of file diff --git a/plugins/postcss-base-plugin/test/cli/src/b.css b/plugins/postcss-base-plugin/test/cli/src/b.css index 5f2435156..a2bc96978 100644 --- a/plugins/postcss-base-plugin/test/cli/src/b.css +++ b/plugins/postcss-base-plugin/test/cli/src/b.css @@ -1,3 +1 @@ -.baz { - color: red; -} +.baz { color: red; } \ No newline at end of file diff --git a/plugins/postcss-base-plugin/test/cli/test.sh b/plugins/postcss-base-plugin/test/cli/test.sh index 1995c10e7..fd2279445 100644 --- a/plugins/postcss-base-plugin/test/cli/test.sh +++ b/plugins/postcss-base-plugin/test/cli/test.sh @@ -1,6 +1,7 @@ set -e -echo $OSTYPE +# Tests should not be single line without trailing newline. +# Otherwise sourcemaps differ between Unix and Windows. # Zero out result file echo '' > ./test/cli/basic.result.css; @@ -9,12 +10,7 @@ echo '' > ./test/cli/basic.result.css; postcss-base-plugin ./test/cli/basic.css --output ./test/cli/basic.result.css # Check result -if [[ "$OSTYPE" == "msys" ]]; then - # CRLF on Windows makes it hard to test with base64 encoded sourcemaps - echo 'did not compare actual output assuming exit 0 means everything is ok' -else - git --no-pager diff --no-index --word-diff ./test/cli/basic.expect.css ./test/cli/basic.result.css -fi +git --no-pager diff --no-index --word-diff ./test/cli/basic.expect.css ./test/cli/basic.result.css # Reset result file cat ./test/cli/basic.css > ./test/cli/basic.replace.css; @@ -23,12 +19,7 @@ cat ./test/cli/basic.css > ./test/cli/basic.replace.css; postcss-base-plugin ./test/cli/basic.replace.css -r # Check result -if [[ "$OSTYPE" == "msys" ]]; then - # CRLF on Windows makes it hard to test with base64 encoded sourcemaps - echo 'did not compare actual output assuming exit 0 means everything is ok' -else - git --no-pager diff --no-index --word-diff ./test/cli/basic.replace.css ./test/cli/basic.replace.expect.css -fi +git --no-pager diff --no-index --word-diff ./test/cli/basic.replace.css ./test/cli/basic.replace.expect.css # Zero out result file echo '' > ./test/cli/basic.color.result.css; @@ -37,12 +28,7 @@ echo '' > ./test/cli/basic.color.result.css; postcss-base-plugin ./test/cli/basic.css -o ./test/cli/basic.color.result.css -p '{ "color": "purple" }' # Check result -if [[ "$OSTYPE" == "msys" ]]; then - # CRLF on Windows makes it hard to test with base64 encoded sourcemaps - echo 'did not compare actual output assuming exit 0 means everything is ok' -else - git --no-pager diff --no-index --word-diff ./test/cli/basic.color.expect.css ./test/cli/basic.color.result.css -fi +git --no-pager diff --no-index --word-diff ./test/cli/basic.color.expect.css ./test/cli/basic.color.result.css # Zero out result file echo '' > ./test/cli/basic.stdin.result.css; @@ -51,12 +37,7 @@ echo '' > ./test/cli/basic.stdin.result.css; cat ./test/cli/basic.css | postcss-base-plugin > ./test/cli/basic.stdin.result.css # Check result -if [[ "$OSTYPE" == "msys" ]]; then - # CRLF on Windows makes it hard to test with base64 encoded sourcemaps - echo 'did not compare actual output assuming exit 0 means everything is ok' -else - git --no-pager diff --no-index --word-diff ./test/cli/basic.stdin.expect.css ./test/cli/basic.stdin.result.css -fi +git --no-pager diff --no-index --word-diff ./test/cli/basic.stdin.expect.css ./test/cli/basic.stdin.result.css # Zero out result file echo '' > ./test/cli/basic.no-map.result.css; @@ -76,12 +57,7 @@ cat ./test/cli/basic.css | postcss-base-plugin --map -o ./test/cli/basic.extern # Check result git --no-pager diff --no-index --word-diff ./test/cli/basic.external-map.expect.css ./test/cli/basic.external-map.result.css -if [[ "$OSTYPE" == "msys" ]]; then - # CRLF on Windows makes it hard to test with base64 encoded sourcemaps - echo 'did not compare actual output assuming exit 0 means everything is ok' -else - git --no-pager diff --no-index --word-diff ./test/cli/basic.external-map.expect.css.map ./test/cli/basic.external-map.result.css.map -fi +git --no-pager diff --no-index --word-diff ./test/cli/basic.external-map.expect.css.map ./test/cli/basic.external-map.result.css.map # Zero out result file echo '' > ./test/cli/out/a.css @@ -95,14 +71,9 @@ postcss-base-plugin ./test/cli/src/a.css ./test/cli/src/b.css -m -d ./test/cli/o # Check result git --no-pager diff --no-index --word-diff ./test/cli/out/a.css ./test/cli/out/a.expect.css git --no-pager diff --no-index --word-diff ./test/cli/out/b.css ./test/cli/out/b.expect.css +git --no-pager diff --no-index --word-diff ./test/cli/out/a.css.map ./test/cli/out/a.expect.css.map +git --no-pager diff --no-index --word-diff ./test/cli/out/b.css.map ./test/cli/out/b.expect.css.map -if [[ "$OSTYPE" == "msys" ]]; then - # CRLF on Windows makes it hard to test with base64 encoded sourcemaps - echo 'did not compare actual output assuming exit 0 means everything is ok' -else - git --no-pager diff --no-index --word-diff ./test/cli/out/a.css.map ./test/cli/out/a.expect.css.map - git --no-pager diff --no-index --word-diff ./test/cli/out/b.css.map ./test/cli/out/b.expect.css.map -fi # Zero out result file echo '' > ./test/cli/out/concatenated.css From aa70c32e1c86577ebd44392ba8242c1685aed1bb Mon Sep 17 00:00:00 2001 From: romainmenke Date: Mon, 22 Nov 2021 08:31:50 +0100 Subject: [PATCH 2/3] try with just .gitattributes --- .../postcss-base-plugin/test/cli/basic.color.expect.css | 7 +++++-- plugins/postcss-base-plugin/test/cli/basic.css | 4 +++- plugins/postcss-base-plugin/test/cli/basic.expect.css | 7 +++++-- .../test/cli/basic.external-map.expect.css | 5 ++++- .../test/cli/basic.external-map.expect.css.map | 2 +- .../postcss-base-plugin/test/cli/basic.no-map.expect.css | 4 +++- plugins/postcss-base-plugin/test/cli/basic.replace.css | 7 +++++-- .../postcss-base-plugin/test/cli/basic.replace.expect.css | 7 +++++-- .../postcss-base-plugin/test/cli/basic.stdin.expect.css | 7 +++++-- plugins/postcss-base-plugin/test/cli/out/a.css | 5 ++++- plugins/postcss-base-plugin/test/cli/out/a.css.map | 2 +- plugins/postcss-base-plugin/test/cli/out/a.expect.css | 5 ++++- plugins/postcss-base-plugin/test/cli/out/a.expect.css.map | 2 +- plugins/postcss-base-plugin/test/cli/out/b.css | 5 ++++- plugins/postcss-base-plugin/test/cli/out/b.css.map | 2 +- plugins/postcss-base-plugin/test/cli/out/b.expect.css | 5 ++++- plugins/postcss-base-plugin/test/cli/out/b.expect.css.map | 2 +- plugins/postcss-base-plugin/test/cli/out/concatenated.css | 7 ++++++- .../test/cli/out/concatenated.expect.css | 7 ++++++- plugins/postcss-base-plugin/test/cli/src/a.css | 4 +++- plugins/postcss-base-plugin/test/cli/src/b.css | 4 +++- 21 files changed, 74 insertions(+), 26 deletions(-) diff --git a/plugins/postcss-base-plugin/test/cli/basic.color.expect.css b/plugins/postcss-base-plugin/test/cli/basic.color.expect.css index f0c396647..93f6b5280 100644 --- a/plugins/postcss-base-plugin/test/cli/basic.color.expect.css +++ b/plugins/postcss-base-plugin/test/cli/basic.color.expect.css @@ -1,2 +1,5 @@ -.foo { color: purple; } -/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJhc2ljLmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLGFBQVUsRUFBRSIsImZpbGUiOiJiYXNpYy5jb2xvci5yZXN1bHQuY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLmZvbyB7IGNvbG9yOiByZWQ7IH0iXX0= */ +.foo { + color: purple; +} + +/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJhc2ljLmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtDQUNDLGFBQVU7QUFDWCIsImZpbGUiOiJiYXNpYy5jb2xvci5yZXN1bHQuY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLmZvbyB7XG5cdGNvbG9yOiByZWQ7XG59XG4iXX0= */ diff --git a/plugins/postcss-base-plugin/test/cli/basic.css b/plugins/postcss-base-plugin/test/cli/basic.css index 91ec900c0..cedf0a6d1 100644 --- a/plugins/postcss-base-plugin/test/cli/basic.css +++ b/plugins/postcss-base-plugin/test/cli/basic.css @@ -1 +1,3 @@ -.foo { color: red; } \ No newline at end of file +.foo { + color: red; +} diff --git a/plugins/postcss-base-plugin/test/cli/basic.expect.css b/plugins/postcss-base-plugin/test/cli/basic.expect.css index 57f3fb9fe..3f6f0d3a4 100644 --- a/plugins/postcss-base-plugin/test/cli/basic.expect.css +++ b/plugins/postcss-base-plugin/test/cli/basic.expect.css @@ -1,2 +1,5 @@ -.foo { color: blue; } -/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJhc2ljLmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLFdBQVUsRUFBRSIsImZpbGUiOiJiYXNpYy5yZXN1bHQuY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLmZvbyB7IGNvbG9yOiByZWQ7IH0iXX0= */ +.foo { + color: blue; +} + +/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJhc2ljLmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtDQUNDLFdBQVU7QUFDWCIsImZpbGUiOiJiYXNpYy5yZXN1bHQuY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLmZvbyB7XG5cdGNvbG9yOiByZWQ7XG59XG4iXX0= */ diff --git a/plugins/postcss-base-plugin/test/cli/basic.external-map.expect.css b/plugins/postcss-base-plugin/test/cli/basic.external-map.expect.css index 62c292276..b8aaa92b1 100644 --- a/plugins/postcss-base-plugin/test/cli/basic.external-map.expect.css +++ b/plugins/postcss-base-plugin/test/cli/basic.external-map.expect.css @@ -1,2 +1,5 @@ -.foo { color: blue; } +.foo { + color: blue; +} + /*# sourceMappingURL=basic.external-map.result.css.map */ \ No newline at end of file diff --git a/plugins/postcss-base-plugin/test/cli/basic.external-map.expect.css.map b/plugins/postcss-base-plugin/test/cli/basic.external-map.expect.css.map index 209346075..8f8e733cc 100644 --- a/plugins/postcss-base-plugin/test/cli/basic.external-map.expect.css.map +++ b/plugins/postcss-base-plugin/test/cli/basic.external-map.expect.css.map @@ -1 +1 @@ -{"version":3,"sources":["../../stdin"],"names":[],"mappings":"AAAA,OAAO,WAAU,EAAE","file":"basic.external-map.result.css","sourcesContent":[".foo { color: red; }"]} \ No newline at end of file +{"version":3,"sources":["../../stdin"],"names":[],"mappings":"AAAA;CACC,WAAU;AACX","file":"basic.external-map.result.css","sourcesContent":[".foo {\n\tcolor: red;\n}\n"]} \ No newline at end of file diff --git a/plugins/postcss-base-plugin/test/cli/basic.no-map.expect.css b/plugins/postcss-base-plugin/test/cli/basic.no-map.expect.css index dca92f52d..c47fa33b8 100644 --- a/plugins/postcss-base-plugin/test/cli/basic.no-map.expect.css +++ b/plugins/postcss-base-plugin/test/cli/basic.no-map.expect.css @@ -1 +1,3 @@ -.foo { color: blue; } \ No newline at end of file +.foo { + color: blue; +} diff --git a/plugins/postcss-base-plugin/test/cli/basic.replace.css b/plugins/postcss-base-plugin/test/cli/basic.replace.css index 7eb73eebb..49bc11102 100644 --- a/plugins/postcss-base-plugin/test/cli/basic.replace.css +++ b/plugins/postcss-base-plugin/test/cli/basic.replace.css @@ -1,2 +1,5 @@ -.foo { color: blue; } -/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJhc2ljLnJlcGxhY2UuY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sV0FBVSxFQUFFIiwiZmlsZSI6ImJhc2ljLnJlcGxhY2UuY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLmZvbyB7IGNvbG9yOiByZWQ7IH0iXX0= */ +.foo { + color: blue; +} + +/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJhc2ljLnJlcGxhY2UuY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0NBQ0MsV0FBVTtBQUNYIiwiZmlsZSI6ImJhc2ljLnJlcGxhY2UuY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLmZvbyB7XG5cdGNvbG9yOiByZWQ7XG59XG4iXX0= */ diff --git a/plugins/postcss-base-plugin/test/cli/basic.replace.expect.css b/plugins/postcss-base-plugin/test/cli/basic.replace.expect.css index 7eb73eebb..49bc11102 100644 --- a/plugins/postcss-base-plugin/test/cli/basic.replace.expect.css +++ b/plugins/postcss-base-plugin/test/cli/basic.replace.expect.css @@ -1,2 +1,5 @@ -.foo { color: blue; } -/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJhc2ljLnJlcGxhY2UuY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sV0FBVSxFQUFFIiwiZmlsZSI6ImJhc2ljLnJlcGxhY2UuY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLmZvbyB7IGNvbG9yOiByZWQ7IH0iXX0= */ +.foo { + color: blue; +} + +/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJhc2ljLnJlcGxhY2UuY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0NBQ0MsV0FBVTtBQUNYIiwiZmlsZSI6ImJhc2ljLnJlcGxhY2UuY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLmZvbyB7XG5cdGNvbG9yOiByZWQ7XG59XG4iXX0= */ diff --git a/plugins/postcss-base-plugin/test/cli/basic.stdin.expect.css b/plugins/postcss-base-plugin/test/cli/basic.stdin.expect.css index 87ed91701..7def14035 100644 --- a/plugins/postcss-base-plugin/test/cli/basic.stdin.expect.css +++ b/plugins/postcss-base-plugin/test/cli/basic.stdin.expect.css @@ -1,2 +1,5 @@ -.foo { color: blue; } -/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0ZGluIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sV0FBVSxFQUFFIiwiZmlsZSI6InN0ZG91dCIsInNvdXJjZXNDb250ZW50IjpbIi5mb28geyBjb2xvcjogcmVkOyB9Il19 */ +.foo { + color: blue; +} + +/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0ZGluIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0NBQ0MsV0FBVTtBQUNYIiwiZmlsZSI6InN0ZG91dCIsInNvdXJjZXNDb250ZW50IjpbIi5mb28ge1xuXHRjb2xvcjogcmVkO1xufVxuIl19 */ diff --git a/plugins/postcss-base-plugin/test/cli/out/a.css b/plugins/postcss-base-plugin/test/cli/out/a.css index 95953ad4c..60e2001c0 100644 --- a/plugins/postcss-base-plugin/test/cli/out/a.css +++ b/plugins/postcss-base-plugin/test/cli/out/a.css @@ -1,2 +1,5 @@ -.foo { color: blue; } +.foo { + color: blue; +} + /*# sourceMappingURL=a.css.map */ \ No newline at end of file diff --git a/plugins/postcss-base-plugin/test/cli/out/a.css.map b/plugins/postcss-base-plugin/test/cli/out/a.css.map index 92ec84a81..d5c8b6f40 100644 --- a/plugins/postcss-base-plugin/test/cli/out/a.css.map +++ b/plugins/postcss-base-plugin/test/cli/out/a.css.map @@ -1 +1 @@ -{"version":3,"sources":["../src/a.css"],"names":[],"mappings":"AAAA,OAAO,WAAU,EAAE","file":"a.css","sourcesContent":[".foo { color: red; }"]} \ No newline at end of file +{"version":3,"sources":["../src/a.css"],"names":[],"mappings":"AAAA;CACC,WAAU;AACX","file":"a.css","sourcesContent":[".foo {\n\tcolor: red;\n}\n"]} \ No newline at end of file diff --git a/plugins/postcss-base-plugin/test/cli/out/a.expect.css b/plugins/postcss-base-plugin/test/cli/out/a.expect.css index 95953ad4c..60e2001c0 100644 --- a/plugins/postcss-base-plugin/test/cli/out/a.expect.css +++ b/plugins/postcss-base-plugin/test/cli/out/a.expect.css @@ -1,2 +1,5 @@ -.foo { color: blue; } +.foo { + color: blue; +} + /*# sourceMappingURL=a.css.map */ \ No newline at end of file diff --git a/plugins/postcss-base-plugin/test/cli/out/a.expect.css.map b/plugins/postcss-base-plugin/test/cli/out/a.expect.css.map index 92ec84a81..d5c8b6f40 100644 --- a/plugins/postcss-base-plugin/test/cli/out/a.expect.css.map +++ b/plugins/postcss-base-plugin/test/cli/out/a.expect.css.map @@ -1 +1 @@ -{"version":3,"sources":["../src/a.css"],"names":[],"mappings":"AAAA,OAAO,WAAU,EAAE","file":"a.css","sourcesContent":[".foo { color: red; }"]} \ No newline at end of file +{"version":3,"sources":["../src/a.css"],"names":[],"mappings":"AAAA;CACC,WAAU;AACX","file":"a.css","sourcesContent":[".foo {\n\tcolor: red;\n}\n"]} \ No newline at end of file diff --git a/plugins/postcss-base-plugin/test/cli/out/b.css b/plugins/postcss-base-plugin/test/cli/out/b.css index 88991c625..ac091faeb 100644 --- a/plugins/postcss-base-plugin/test/cli/out/b.css +++ b/plugins/postcss-base-plugin/test/cli/out/b.css @@ -1,2 +1,5 @@ -.baz { color: blue; } +.baz { + color: blue; +} + /*# sourceMappingURL=b.css.map */ \ No newline at end of file diff --git a/plugins/postcss-base-plugin/test/cli/out/b.css.map b/plugins/postcss-base-plugin/test/cli/out/b.css.map index 9679cfbd7..0a97ca290 100644 --- a/plugins/postcss-base-plugin/test/cli/out/b.css.map +++ b/plugins/postcss-base-plugin/test/cli/out/b.css.map @@ -1 +1 @@ -{"version":3,"sources":["../src/b.css"],"names":[],"mappings":"AAAA,OAAO,WAAU,EAAE","file":"b.css","sourcesContent":[".baz { color: red; }"]} \ No newline at end of file +{"version":3,"sources":["../src/b.css"],"names":[],"mappings":"AAAA;CACC,WAAU;AACX","file":"b.css","sourcesContent":[".baz {\n\tcolor: red;\n}\n"]} \ No newline at end of file diff --git a/plugins/postcss-base-plugin/test/cli/out/b.expect.css b/plugins/postcss-base-plugin/test/cli/out/b.expect.css index 88991c625..ac091faeb 100644 --- a/plugins/postcss-base-plugin/test/cli/out/b.expect.css +++ b/plugins/postcss-base-plugin/test/cli/out/b.expect.css @@ -1,2 +1,5 @@ -.baz { color: blue; } +.baz { + color: blue; +} + /*# sourceMappingURL=b.css.map */ \ No newline at end of file diff --git a/plugins/postcss-base-plugin/test/cli/out/b.expect.css.map b/plugins/postcss-base-plugin/test/cli/out/b.expect.css.map index 9679cfbd7..0a97ca290 100644 --- a/plugins/postcss-base-plugin/test/cli/out/b.expect.css.map +++ b/plugins/postcss-base-plugin/test/cli/out/b.expect.css.map @@ -1 +1 @@ -{"version":3,"sources":["../src/b.css"],"names":[],"mappings":"AAAA,OAAO,WAAU,EAAE","file":"b.css","sourcesContent":[".baz { color: red; }"]} \ No newline at end of file +{"version":3,"sources":["../src/b.css"],"names":[],"mappings":"AAAA;CACC,WAAU;AACX","file":"b.css","sourcesContent":[".baz {\n\tcolor: red;\n}\n"]} \ No newline at end of file diff --git a/plugins/postcss-base-plugin/test/cli/out/concatenated.css b/plugins/postcss-base-plugin/test/cli/out/concatenated.css index ded6a1390..80726df77 100644 --- a/plugins/postcss-base-plugin/test/cli/out/concatenated.css +++ b/plugins/postcss-base-plugin/test/cli/out/concatenated.css @@ -1 +1,6 @@ -.foo { color: blue; }.baz { color: blue; } \ No newline at end of file +.foo { + color: blue; +} +.baz { + color: blue; +} diff --git a/plugins/postcss-base-plugin/test/cli/out/concatenated.expect.css b/plugins/postcss-base-plugin/test/cli/out/concatenated.expect.css index ded6a1390..80726df77 100644 --- a/plugins/postcss-base-plugin/test/cli/out/concatenated.expect.css +++ b/plugins/postcss-base-plugin/test/cli/out/concatenated.expect.css @@ -1 +1,6 @@ -.foo { color: blue; }.baz { color: blue; } \ No newline at end of file +.foo { + color: blue; +} +.baz { + color: blue; +} diff --git a/plugins/postcss-base-plugin/test/cli/src/a.css b/plugins/postcss-base-plugin/test/cli/src/a.css index 91ec900c0..cedf0a6d1 100644 --- a/plugins/postcss-base-plugin/test/cli/src/a.css +++ b/plugins/postcss-base-plugin/test/cli/src/a.css @@ -1 +1,3 @@ -.foo { color: red; } \ No newline at end of file +.foo { + color: red; +} diff --git a/plugins/postcss-base-plugin/test/cli/src/b.css b/plugins/postcss-base-plugin/test/cli/src/b.css index a2bc96978..5f2435156 100644 --- a/plugins/postcss-base-plugin/test/cli/src/b.css +++ b/plugins/postcss-base-plugin/test/cli/src/b.css @@ -1 +1,3 @@ -.baz { color: red; } \ No newline at end of file +.baz { + color: red; +} From e0932695c5a8987610c4ed4b53c652393e6d54af Mon Sep 17 00:00:00 2001 From: romainmenke Date: Mon, 22 Nov 2021 08:44:32 +0100 Subject: [PATCH 3/3] cleanup --- plugins/postcss-base-plugin/test/cli/.editorconfig | 5 ----- plugins/postcss-base-plugin/test/cli/test.sh | 3 --- 2 files changed, 8 deletions(-) delete mode 100644 plugins/postcss-base-plugin/test/cli/.editorconfig diff --git a/plugins/postcss-base-plugin/test/cli/.editorconfig b/plugins/postcss-base-plugin/test/cli/.editorconfig deleted file mode 100644 index d70510bdf..000000000 --- a/plugins/postcss-base-plugin/test/cli/.editorconfig +++ /dev/null @@ -1,5 +0,0 @@ -[*.css] -insert_final_newline = false - -[*.css.map] -insert_final_newline = false diff --git a/plugins/postcss-base-plugin/test/cli/test.sh b/plugins/postcss-base-plugin/test/cli/test.sh index fd2279445..3cb230406 100644 --- a/plugins/postcss-base-plugin/test/cli/test.sh +++ b/plugins/postcss-base-plugin/test/cli/test.sh @@ -1,8 +1,5 @@ set -e -# Tests should not be single line without trailing newline. -# Otherwise sourcemaps differ between Unix and Windows. - # Zero out result file echo '' > ./test/cli/basic.result.css;