From 7d4ba05a80b27d682eaf0b3b278aba5a6364987a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Wed, 10 Apr 2024 10:41:14 +0200 Subject: [PATCH] Add `crystal tool format` tests --- test/helper/common.bash | 4 +++ test/libraries.bats | 62 +++++++++++++++++++++++++++++++++++++++++ test/testing.bats | 8 ++++++ test/tools.bats | 2 ++ 4 files changed, 76 insertions(+) diff --git a/test/helper/common.bash b/test/helper/common.bash index 26179bf..eb5466f 100644 --- a/test/helper/common.bash +++ b/test/helper/common.bash @@ -38,3 +38,7 @@ function shard_checkout() { function crystal_spec() { $CRYSTAL spec --junit_output ".junit/interpreter-std_spec.$BATS_TEST_NAME.xml" } + +function crystal_format() { + $CRYSTAL tool format +} diff --git a/test/libraries.bats b/test/libraries.bats index 6246960..4b37a7d 100644 --- a/test/libraries.bats +++ b/test/libraries.bats @@ -14,6 +14,8 @@ function setup() { shard_checkout https://github.com/Sija/backtracer.cr crystal_spec + + crystal_format } # bats test_tags=openssl @@ -23,36 +25,48 @@ function setup() { shard_checkout https://github.com/crystal-loot/exception_page crystal_spec + + crystal_format } @test "luislavena/radix" { shard_checkout https://github.com/luislavena/radix crystal_spec + + crystal_format } @test "ysbaddaden/pool" { shard_checkout https://github.com/ysbaddaden/pool crystal_spec + + crystal_format } @test "luckyframework/habitat" { shard_checkout https://github.com/luckyframework/habitat crystal_spec + + crystal_format } @test "luckyframework/wordsmith" { shard_checkout https://github.com/luckyframework/wordsmith crystal_spec + + crystal_format } @test "crystal-community/future.cr" { shard_checkout https://github.com/crystal-community/future.cr crystal_spec + + crystal_format } @test "schovi/baked_file_system" { @@ -60,6 +74,8 @@ function setup() { shard_checkout https://github.com/schovi/baked_file_system crystal_spec + + crystal_format } @test "jeromegn/kilt" { @@ -67,24 +83,32 @@ function setup() { shard_checkout https://github.com/jeromegn/kilt crystal_spec + + crystal_format } @test "sumpycr/stumpy_core" { shard_checkout https://github.com/stumpycr/stumpy_core crystal_spec + + crystal_format } @test "luckyframework/lucky_task" { shard_checkout https://github.com/luckyframework/lucky_task crystal_spec + + crystal_format } @test "spider-gazelle/bindata" { shard_checkout https://github.com/spider-gazelle/bindata crystal_spec + + crystal_format } # bats test_tags=openssl @@ -92,6 +116,8 @@ function setup() { shard_checkout https://github.com/kemalcr/kemal-session crystal_spec + + crystal_format } # bats test_tags=openssl @@ -104,6 +130,8 @@ function setup() { shard_checkout https://github.com/kemalcr/kemal crystal_spec + + crystal_format } @test "luckyframework/teeplate" { @@ -112,12 +140,16 @@ function setup() { shard_checkout https://github.com/luckyframework/teeplate crystal_spec + + crystal_format } @test "icyleaf/markd" { shard_checkout https://github.com/icyleaf/markd crystal_spec + + crystal_format } @test "crystal-lang/json_mapping.cr" { @@ -125,6 +157,8 @@ function setup() { shard_checkout https://github.com/crystal-lang/json_mapping.cr crystal_spec + + crystal_format } @test "stumpycr/stumpy_png" { @@ -133,6 +167,8 @@ function setup() { shard_checkout https://github.com/stumpycr/stumpy_png crystal_spec + + crystal_format } @test "luckyframework/shell-table.cr" { @@ -140,6 +176,8 @@ function setup() { shard_checkout https://github.com/luckyframework/shell-table.cr crystal_spec + + crystal_format } @test "phoffer/inflector.cr" { @@ -147,6 +185,8 @@ function setup() { shard_checkout https://github.com/phoffer/inflector.cr crystal_spec + + crystal_format } # bats test_tags=cmake @@ -156,6 +196,8 @@ function setup() { $CRYSTAL src/ext/build_ext.cr crystal_spec + + crystal_format } @test "icyleaf/halite" { @@ -163,12 +205,16 @@ function setup() { shard_checkout https://github.com/icyleaf/halite crystal_spec + + crystal_format } @test "jwaldrip/admiral.cr" { shard_checkout https://github.com/jwaldrip/admiral.cr crystal_spec + + crystal_format } @test "jeromegn/slang" { @@ -180,12 +226,16 @@ function setup() { shard_checkout https://github.com/jeromegn/slang crystal_spec + + crystal_format } @test "vladfaust/time_format.cr" { shard_checkout https://github.com/vladfaust/time_format.cr crystal_spec + + crystal_format } @test "mamantoha/http_proxy" { @@ -193,12 +243,16 @@ function setup() { shard_checkout https://github.com/mamantoha/http_proxy crystal_spec + + crystal_format } @test "crystal-community/msgpack-crystal" { shard_checkout https://github.com/crystal-community/msgpack-crystal crystal_spec + + crystal_format } @test "spider-gazelle/openssl_ext" { @@ -206,12 +260,16 @@ function setup() { shard_checkout https://github.com/spider-gazelle/openssl_ext crystal_spec + + crystal_format } @test "gdotdesign/cr-dotenv" { shard_checkout https://github.com/gdotdesign/cr-dotenv crystal_spec + + crystal_format } @test "maiha/pretty.cr" { @@ -219,6 +277,8 @@ function setup() { shard_checkout https://github.com/maiha/pretty.cr crystal_spec + + crystal_format } @test "straight-shoota/crinja" { @@ -228,6 +288,8 @@ function setup() { crystal_spec + crystal_format + cd examples bats integration_test.bats } diff --git a/test/testing.bats b/test/testing.bats index e541689..fd77d2a 100644 --- a/test/testing.bats +++ b/test/testing.bats @@ -11,6 +11,8 @@ function setup() { shard_checkout https://github.com/ysbaddaden/minitest.cr crystal_spec + + crystal_format } @test "arctic-fox/spectator" { @@ -18,6 +20,8 @@ function setup() { shard_checkout https://gitlab.com/arctic-fox/spectator crystal_spec + + crystal_format } @test "crystal-community/timecop.cr" { @@ -25,6 +29,8 @@ function setup() { shard_checkout https://github.com/crystal-community/timecop.cr crystal_spec + + crystal_format } @test "manastech/webmock.cr" { @@ -32,4 +38,6 @@ function setup() { shard_checkout https://github.com/manastech/webmock.cr crystal_spec + + crystal_format } diff --git a/test/tools.bats b/test/tools.bats index e4decf2..e38bd6f 100644 --- a/test/tools.bats +++ b/test/tools.bats @@ -17,4 +17,6 @@ function setup() { fi crystal_spec + + crystal_format }