Skip to content

Commit

Permalink
Update glint to v1.0.0-rc1
Browse files Browse the repository at this point in the history
  • Loading branch information
maxdeviant committed Apr 21, 2024
1 parent ea4424b commit 36e5cec
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 18 deletions.
2 changes: 1 addition & 1 deletion gleam.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ gleam_community_ansi = ">= 1.4.0 and < 2.0.0"
gleam_erlang = ">= 0.25.0 and < 1.0.0"
gleam_javascript = ">= 0.8.0 and < 1.0.0"
gleam_stdlib = ">= 0.34.0 and < 2.0.0"
glint = ">= 0.18.0 and < 1.0.0"
glint = ">= 1.0.0-rc1 and < 1.0.0"
simplifile = ">= 1.7.0 and < 2.0.0"
tom = ">= 0.3.0 and < 1.0.0"

Expand Down
6 changes: 3 additions & 3 deletions manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ packages = [
{ name = "gleam_javascript", version = "0.8.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_javascript", source = "hex", outer_checksum = "14D5B7E1A70681E0776BF0A0357F575B822167960C844D3D3FA114D3A75F05A8" },
{ name = "gleam_json", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib", "thoas"], otp_app = "gleam_json", source = "hex", outer_checksum = "8B197DD5D578EA6AC2C0D4BDC634C71A5BCA8E7DB5F47091C263ECB411A60DF3" },
{ name = "gleam_stdlib", version = "0.36.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "C0D14D807FEC6F8A08A7C9EF8DFDE6AE5C10E40E21325B2B29365965D82EB3D4" },
{ name = "glint", version = "0.18.0", build_tools = ["gleam"], requirements = ["gleam_community_ansi", "gleam_community_colour", "gleam_stdlib", "snag"], otp_app = "glint", source = "hex", outer_checksum = "BB0F14643CC51C069A5DC6E9082EAFCD9967AFD1C9CC408803D1A40A3FD43B54" },
{ name = "glint", version = "1.0.0-rc1", build_tools = ["gleam"], requirements = ["gleam_community_ansi", "gleam_community_colour", "gleam_stdlib", "snag"], otp_app = "glint", source = "hex", outer_checksum = "91EC8EFA3E8FBCB842C219AA02E8072204CEE02597B4C36C2ED78AD86DD1B2EC" },
{ name = "ranger", version = "1.2.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "ranger", source = "hex", outer_checksum = "1566C272B1D141B3BBA38B25CB761EF56E312E79EC0E2DFD4D3C19FB0CC1F98C" },
{ name = "simplifile", version = "1.7.0", build_tools = ["gleam"], requirements = ["filepath", "gleam_stdlib"], otp_app = "simplifile", source = "hex", outer_checksum = "1D5DFA3A2F9319EC85825F6ED88B8E449F381B0D55A62F5E61424E748E7DDEB0" },
{ name = "snag", version = "0.3.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "snag", source = "hex", outer_checksum = "54D32E16E33655346AA3E66CBA7E191DE0A8793D2C05284E3EFB90AD2CE92BCC" },
Expand All @@ -28,6 +28,6 @@ gleam_community_ansi = { version = ">= 1.4.0 and < 2.0.0" }
gleam_erlang = { version = ">= 0.25.0 and < 1.0.0" }
gleam_javascript = { version = ">= 0.8.0 and < 1.0.0" }
gleam_stdlib = { version = ">= 0.34.0 and < 2.0.0" }
glint = { version = ">= 0.18.0 and < 1.0.0" }
glint = { version = ">= 1.0.0-rc1 and < 1.0.0" }
simplifile = { version = ">= 1.7.0 and < 2.0.0" }
tom = { version = ">= 0.3.0 and < 1.0.0"}
tom = { version = ">= 0.3.0 and < 1.0.0" }
27 changes: 13 additions & 14 deletions src/startest/cli.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import argv
import gleam/option.{None, Some}
import glint
import glint/flag
import startest/config.{type Config}
import startest/context.{Context}
import startest/internal/runner
Expand All @@ -12,15 +11,16 @@ import startest/logger.{Logger}
/// Runs the Startest CLI.
pub fn run(config: Config) {
glint.new()
|> glint.with_name("gleam test --")
|> glint.with_pretty_help(glint.default_pretty_help())
|> glint.add(
at: [],
do: glint.command(fn(input: glint.CommandInput) {
let filters = input.args
|> glint.name("gleam test --")
|> glint.pretty_help(glint.default_pretty_help())
|> glint.add(at: [], do: {
use _ <- glint.flag(test_name_filter, test_name_filter_flag())

glint.command(fn(_named_args, args, flags) {
let filters = args

let assert Ok(filter) =
flag.get_string(from: input.flags, for: test_name_filter)
glint.get_string(from: flags, for: test_name_filter)

let config =
config
Expand All @@ -34,17 +34,16 @@ pub fn run(config: Config) {

runner.run_tests(ctx)
})
|> glint.flag(test_name_filter, test_name_filter_flag()),
)
})
|> glint.run(argv.load().arguments)
}

const test_name_filter = "filter"

fn test_name_filter_flag() -> flag.FlagBuilder(String) {
flag.string()
|> flag.default("")
|> flag.description(
fn test_name_filter_flag() -> glint.Flag(String) {
glint.string()
|> glint.default("")
|> glint.flag_help(
"Filter down tests just to those whose names match the filter",
)
}

0 comments on commit 36e5cec

Please sign in to comment.