Skip to content

Commit

Permalink
v1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lpil committed Jul 24, 2023
1 parent c4018c4 commit 25ecf62
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 9 deletions.
5 changes: 5 additions & 0 deletions runner/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## v1.3.0 - 2023-07-16

- Diffing has been re-enabled. Thanks to @JohnBjrk for the new improved diffing
algorithm!

## v1.2.0 - 2023-07-10

- Diffing of the expected and actual output has been temporarily removed due to
Expand Down
3 changes: 2 additions & 1 deletion runner/gleam.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name = "exercism_test_runner"
version = "1.2.0"
version = "1.3.0"
description = "A test framework for Gleam exercises on Exercism"
licences = ["Apache-2.0"]
repository = { type = "github", user = "exercism", repo = "gleam-test-runner" }
links = [{ title = "Website", href = "https://exercism.org/tracks/gleam" }]

[dependencies]
gap = "~> 0.7"
glance = "~> 0.5"
gleam_erlang = "~> 0.19"
gleam_json = "~> 0.5"
Expand Down
12 changes: 7 additions & 5 deletions runner/manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@
# You typically do not need to edit this file

packages = [
{ name = "glance", version = "0.6.1", build_tools = ["gleam"], requirements = ["glexer", "gleam_stdlib"], otp_app = "glance", source = "hex", outer_checksum = "1E6049A9E728C3448E8C29092F7ECBC29796532D8356B908E7E200BDC4969087" },
{ name = "gap", version = "0.7.0", build_tools = ["gleam"], requirements = ["gleam_stdlib", "gleam_community_ansi"], otp_app = "gap", source = "hex", outer_checksum = "AF290C27B3FAE5FE64E1B7E9C70A9E29AA0F42429C0592D375770C1C51B79D36" },
{ name = "glance", version = "0.6.1", build_tools = ["gleam"], requirements = ["gleam_stdlib", "glexer"], otp_app = "glance", source = "hex", outer_checksum = "1E6049A9E728C3448E8C29092F7ECBC29796532D8356B908E7E200BDC4969087" },
{ name = "gleam_bitwise", version = "1.2.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_bitwise", source = "hex", outer_checksum = "6064699EFBABB1CA392DCB193D0E8B402FB042B4B46857B01E6875E643B57F54" },
{ name = "gleam_community_ansi", version = "1.1.0", build_tools = ["gleam"], requirements = ["gleam_community_colour", "gleam_bitwise", "gleam_stdlib"], otp_app = "gleam_community_ansi", source = "hex", outer_checksum = "6E4E0CF2B207C1A7FCD3C21AA43514D67BC7004F21F82045CDCCE6C727A14862" },
{ name = "gleam_community_ansi", version = "1.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib", "gleam_bitwise", "gleam_community_colour"], otp_app = "gleam_community_ansi", source = "hex", outer_checksum = "6E4E0CF2B207C1A7FCD3C21AA43514D67BC7004F21F82045CDCCE6C727A14862" },
{ name = "gleam_community_colour", version = "1.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib", "gleam_bitwise"], otp_app = "gleam_community_colour", source = "hex", outer_checksum = "D27CE357ECB343929A8CEC3FBA0B499943A47F0EE1F589EE16AFC2DC21C61E5B" },
{ name = "gleam_erlang", version = "0.19.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_erlang", source = "hex", outer_checksum = "720D1E0A0CEBBD51C4AA88501D1D4FBFEF4AA7B3332C994691ED944767A52582" },
{ name = "gleam_json", version = "0.5.1", build_tools = ["gleam"], requirements = ["thoas", "gleam_stdlib"], otp_app = "gleam_json", source = "hex", outer_checksum = "9A805C1E60FB9CD73AF3034EB464268A6B522D937FCD2DF92BD246F2F4B37930" },
{ name = "gleam_stdlib", version = "0.29.2", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "B296BF9B8AA384A6B64CD49F333016A9DCA6AC73A95400D17F2271E072EFF986" },
{ name = "gleam_json", version = "0.5.1", build_tools = ["gleam"], requirements = ["gleam_stdlib", "thoas"], otp_app = "gleam_json", source = "hex", outer_checksum = "9A805C1E60FB9CD73AF3034EB464268A6B522D937FCD2DF92BD246F2F4B37930" },
{ name = "gleam_stdlib", version = "0.30.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "03710B3DA047A3683117591707FCA19D32B980229DD8CE8B0603EB5B5144F6C3" },
{ name = "glexer", version = "0.6.2", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "glexer", source = "hex", outer_checksum = "703D2347F5180B2BCEA4D258549B0D91DACD0905010892BAC46D04D913B84D1F" },
{ name = "simplifile", version = "0.1.4", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "simplifile", source = "hex", outer_checksum = "09BD13BAA1A86B1D7AC087B39CA3A9A47179375A738C031EA1D3A74D0F78BF6D" },
{ name = "simplifile", version = "0.1.5", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "simplifile", source = "hex", outer_checksum = "835902DE0A1177288A371B8255AD1A38C7E44C7A8C25EE84DE53EEFF40098209" },
{ name = "thoas", version = "0.4.1", build_tools = ["rebar3"], requirements = [], otp_app = "thoas", source = "hex", outer_checksum = "4918D50026C073C4AB1388437132C77A6F6F7C8AC43C60C13758CC0ADCE2134E" },
]

[requirements]
gap = { version = "~> 0.7" }
glance = { version = "~> 0.5" }
gleam_community_ansi = { version = "~> 1.1" }
gleam_erlang = { version = "~> 0.19" }
Expand Down
10 changes: 8 additions & 2 deletions runner/src/exercism_test_runner/internal.gleam
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import gap
import gleam/int
import gleam/json.{Json}
import gleam/list
Expand Down Expand Up @@ -82,12 +83,17 @@ fn print_properties(
pub fn print_error(error: Error, path: String, test_name: String) -> String {
case error {
Unequal(left, right) -> {
let diff =
gap.to_styled(gap.compare_strings(
string.inspect(left),
string.inspect(right),
))
path
|> print_properties([
#("test", test_name),
#("error", "left != right"),
#("left", string.inspect(left)),
#("right", string.inspect(right)),
#("left", diff.first),
#("right", diff.second),
])
}
Todo(message) -> {
Expand Down
11 changes: 10 additions & 1 deletion runner/test/exercism_test_runner_test.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pub fn print_unequal_test() {
\e[36m test: \e[39mwobble_test
\e[36m error: \e[39mleft != right
\e[36m left: \e[39m\"ab\"
\e[36m right: \e[39m\"abc\"",
\e[36m right: \e[39m\"ab\e[1m\e[31mc\e[39m\e[22m\"",
)
}

Expand Down Expand Up @@ -323,3 +323,12 @@ Output was truncated. Please limit to 500 chars"
),
])))
}

// https://github.com/exercism/gleam-test-runner/issues/23
pub fn big_string_test() {
let text =
"On the first day of Christmas my true love gave to me: a Partridge in a Pear Tree.\nOn the second day of Christmas my true love gave to me: two Turtle Doves, and a Partridge in a Pear Tree.\nOn the third day of Christmas my true love gave to me: three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\nOn the fourth day of Christmas my true love gave to me: four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\nOn the fifth day of Christmas my true love gave to me: five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\nOn the sixth day of Christmas my true love gave to me: six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\nOn the seventh day of Christmas my true love gave to me: seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\nOn the eighth day of Christmas my true love gave to me: eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\nOn the ninth day of Christmas my true love gave to me: nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\nOn the tenth day of Christmas my true love gave to me: ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\nOn the eleventh day of Christmas my true love gave to me: eleven Pipers Piping, ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\nOn the twelfth day of Christmas my true love gave to me: twelve Drummers Drumming, eleven Pipers Piping, ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree."
text
// |> should.equal("1" <> text <> "2")
|> should.equal(text)
}

0 comments on commit 25ecf62

Please sign in to comment.