From 06f5ed721d24f8cec55ef169c20db936cf3e82ca Mon Sep 17 00:00:00 2001 From: Sebastian Ehlert <28669218+awvwgk@users.noreply.github.com> Date: Mon, 19 Sep 2022 11:56:33 +0200 Subject: [PATCH] toml-test 1.2.0 (new formula) Closes #111109. Signed-off-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Signed-off-by: Rui Chen Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> --- Formula/toml-test.rb | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Formula/toml-test.rb diff --git a/Formula/toml-test.rb b/Formula/toml-test.rb new file mode 100644 index 00000000000..b84014c9380 --- /dev/null +++ b/Formula/toml-test.rb @@ -0,0 +1,27 @@ +class TomlTest < Formula + desc "Language agnostic test suite for TOML parsers" + homepage "https://github.com/burntsushi/toml-test" + url "https://github.com/BurntSushi/toml-test/archive/refs/tags/v1.2.0.tar.gz" + sha256 "33bf4e9c017cd57f3602e72d17f75fb5a7bcc7942541c84f1d98b74c12499846" + license "MIT" + + depends_on "go" => :build + + def install + system "go", "build", *std_go_args, "./cmd/toml-test" + pkgshare.install "tests" + end + + test do + system bin/"toml-test", "-version" + system bin/"toml-test", "-help" + (testpath/"stub-decoder").write <<~EOS + #!/bin/sh + cat #{pkgshare}/tests/valid/example.json + EOS + chmod 0755, testpath/"stub-decoder" + system bin/"toml-test", "-testdir", pkgshare/"tests", + "-run", "valid/example*", + "--", testpath/"stub-decoder" + end +end