diff --git a/Dockerfile b/Dockerfile index e60bd06..9dedcc0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.18 +FROM alpine:3.23 RUN apk add --no-cache jq sqlite coreutils diff --git a/tests/user-output/user-output_test.sql b/tests/user-output/user-output_test.sql index 481e9de..f200a9d 100644 --- a/tests/user-output/user-output_test.sql +++ b/tests/user-output/user-output_test.sql @@ -12,7 +12,7 @@ DROP TABLE IF EXISTS main.tests; CREATE TABLE IF NOT EXISTS main.tests ( uuid TEXT PRIMARY KEY, name TEXT NOT NULL, - status TEXT DEFAULT "fail", + status TEXT DEFAULT 'fail', message TEXT, output TEXT, test_code TEXT, @@ -23,22 +23,22 @@ CREATE TABLE IF NOT EXISTS main.tests ( INSERT INTO tests (name, uuid, year, result) VALUES - ("not_divisible_by_4", "6466b30d-519c-438e-935d-388224ab5223", 2015, 0), - ("divisible_by_2_not_divisible_by_4", "ac227e82-ee82-4a09-9eb6-4f84331ffdb0", 1970, 0), - ("divisible_by_4_not_divisible_by_100", "4fe9b84c-8e65-489e-970b-856d60b8b78e", 1996, 1), - ("divisible_by_100_not_divisible_by_400", "78a7848f-9667-4192-ae53-87b30c9a02dd", 2100, 0), - ("divisible_by_400", "42ee56ad-d3e6-48f1-8e3f-c84078d916fc", 2000, 1), - ("divisible_by_200_not_divisible_by_400", "c30331f6-f9f6-4881-ad38-8ca8c12520c1", 1800, 0); + ('not_divisible_by_4', '6466b30d-519c-438e-935d-388224ab5223', 2015, 0), + ('divisible_by_2_not_divisible_by_4', 'ac227e82-ee82-4a09-9eb6-4f84331ffdb0', 1970, 0), + ('divisible_by_4_not_divisible_by_100', '4fe9b84c-8e65-489e-970b-856d60b8b78e', 1996, 1), + ('divisible_by_100_not_divisible_by_400', '78a7848f-9667-4192-ae53-87b30c9a02dd', 2100, 0), + ('divisible_by_400', '42ee56ad-d3e6-48f1-8e3f-c84078d916fc', 2000, 1), + ('divisible_by_200_not_divisible_by_400', 'c30331f6-f9f6-4881-ad38-8ca8c12520c1', 1800, 0); UPDATE tests -SET status = "pass" +SET status = 'pass' FROM (SELECT year, is_leap FROM leap) AS actual WHERE (actual.year, actual.is_leap) = (tests.year, tests.result); UPDATE tests -SET message = "Result for " || actual.year || " is: " || actual.is_leap || ", but should be: " || tests.result +SET message = 'Result for ' || actual.year || ' is: ' || actual.is_leap || ', but should be: ' || tests.result FROM (SELECT year, is_leap FROM leap) AS actual -WHERE actual.year = tests.year AND tests.status = "fail"; +WHERE actual.year = tests.year AND tests.status = 'fail'; .mode json .once './output.json' @@ -48,4 +48,4 @@ FROM tests; .mode table SELECT name, status, message -FROM tests; \ No newline at end of file +FROM tests;