From 4561bf06d7a350f57f50f781a7bdc028a07d06ad Mon Sep 17 00:00:00 2001 From: Thomas von Dein Date: Wed, 17 Sep 2025 20:33:48 +0200 Subject: [PATCH] update testscript --- config.go | 2 +- go.mod | 4 ++-- go.sum | 8 ++++---- main_test.go | 9 ++++----- t/debug.txtar | 2 +- t/help.txtar | 2 +- t/list.txtar | 2 +- t/noarg.txtar | 2 +- t/nocode.txtar | 2 +- t/nocodeloop.txtar | 2 +- t/template.txtar | 2 +- t/valid.txtar | 2 +- t/version.txtar | 2 +- 13 files changed, 20 insertions(+), 21 deletions(-) diff --git a/config.go b/config.go index 8badfab..8b40254 100644 --- a/config.go +++ b/config.go @@ -124,7 +124,7 @@ var Templates = map[string]string{ } const ( - VERSION string = "0.0.7" + VERSION string = "0.0.8" DefaultCount int = 160 // number of words to generate if -c is omitted DefaultColumns int = 10 // number of columns to print MaxWidth int = 72 // max width of output, adjusts columns diff --git a/go.mod b/go.mod index 30e368c..917b8fb 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/knadh/koanf/providers/file v1.2.0 github.com/knadh/koanf/providers/posflag v1.0.1 github.com/knadh/koanf/v2 v2.3.0 - github.com/rogpeppe/go-internal v1.13.1 + github.com/rogpeppe/go-internal v1.14.1 github.com/s0rg/fantasyname v1.3.6 github.com/spf13/pflag v1.0.6 github.com/tlinden/yadu v0.1.3 @@ -28,6 +28,6 @@ require ( github.com/pelletier/go-toml v1.9.5 // indirect golang.org/x/sys v0.32.0 // indirect golang.org/x/text v0.21.0 // indirect - golang.org/x/tools v0.22.0 // indirect + golang.org/x/tools v0.26.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 3ee69d6..66872e4 100644 --- a/go.sum +++ b/go.sum @@ -30,8 +30,8 @@ github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3v github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= -github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= +github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= +github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= github.com/s0rg/fantasyname v1.3.6 h1:KOezDl0ijuuIDre06tqMz8idCEIdaM7KMkSnU/8bCxc= github.com/s0rg/fantasyname v1.3.6/go.mod h1:9cZ037rckuT6N7DijPi2xpuuYFgJpLlcbpXMptYuEdY= github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= @@ -45,8 +45,8 @@ golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20= golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= -golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= -golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= +golang.org/x/tools v0.26.0 h1:v/60pFQmzmT9ExmjDv2gGIfi3OqfKoEP6I5+umXlbnQ= +golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/main_test.go b/main_test.go index bdba295..27ca461 100644 --- a/main_test.go +++ b/main_test.go @@ -18,7 +18,6 @@ along with this program. If not, see . package main import ( - "os" "testing" "github.com/rogpeppe/go-internal/testscript" @@ -27,12 +26,12 @@ import ( // see https://bitfieldconsulting.com/golang/test-scripts func TestMain(m *testing.M) { - os.Exit(testscript.RunMain(m, map[string]func() int{ - "testgfn": TMain, - })) + testscript.Main(m, map[string]func(){ + "gfn": main, + }) } -func TestFfn(t *testing.T) { +func TestGfn(t *testing.T) { testscript.Run(t, testscript.Params{ Dir: "t", }) diff --git a/t/debug.txtar b/t/debug.txtar index 74d2829..f1e0287 100644 --- a/t/debug.txtar +++ b/t/debug.txtar @@ -1,2 +1,2 @@ -exec testgfn -d Vs +exec gfn -d Vs stdout 'gfn/generate.go:' diff --git a/t/help.txtar b/t/help.txtar index 6008e83..8abc33c 100644 --- a/t/help.txtar +++ b/t/help.txtar @@ -1,2 +1,2 @@ -exec testgfn -h +exec gfn -h stdout 'This is gfn' diff --git a/t/list.txtar b/t/list.txtar index fabc8b5..f4e6d16 100644 --- a/t/list.txtar +++ b/t/list.txtar @@ -1,2 +1,2 @@ -exec testgfn -l +exec gfn -l stdout 'JapaneseNamesDiverse' diff --git a/t/noarg.txtar b/t/noarg.txtar index 90db264..d40b974 100644 --- a/t/noarg.txtar +++ b/t/noarg.txtar @@ -1 +1 @@ -! exec testgfn +! exec gfn diff --git a/t/nocode.txtar b/t/nocode.txtar index 7f5e724..e75092d 100644 --- a/t/nocode.txtar +++ b/t/nocode.txtar @@ -1,2 +1,2 @@ -exec testgfn akx +exec gfn akx stdout 'akx' diff --git a/t/nocodeloop.txtar b/t/nocodeloop.txtar index 7ea9b91..058032b 100644 --- a/t/nocodeloop.txtar +++ b/t/nocodeloop.txtar @@ -1,2 +1,2 @@ -exec testgfn akx +exec gfn akx ! stdout 'akx akx' diff --git a/t/template.txtar b/t/template.txtar index cfeca63..5202fd0 100644 --- a/t/template.txtar +++ b/t/template.txtar @@ -1,2 +1,2 @@ -exec testgfn Idiots +exec gfn Idiots stdout 'face' diff --git a/t/valid.txtar b/t/valid.txtar index d4f6c0b..eb86765 100644 --- a/t/valid.txtar +++ b/t/valid.txtar @@ -1,2 +1,2 @@ -exec testgfn sVdmi(usus|hehe) +exec gfn sVdmi(usus|hehe) stdout 'usus' diff --git a/t/version.txtar b/t/version.txtar index 47a5ff0..7c5b9bb 100644 --- a/t/version.txtar +++ b/t/version.txtar @@ -1,2 +1,2 @@ -exec testgfn -v +exec gfn -v stdout 'This is gfn version'