commit 13181c6206287cc37f445e95e4958656910af146
parent ac663d9d78e7f96596d477c37c40467d4a47260f
Author: Sean Enck <sean@ttypty.com>
Date: Sat, 16 Jul 2022 09:19:01 -0400
more tests for args
Diffstat:
1 file changed, 50 insertions(+), 0 deletions(-)
diff --git a/internal/args_test.go b/internal/args_test.go
@@ -0,0 +1,50 @@
+package internal
+
+import (
+ "testing"
+)
+
+func TestClipArg(t *testing.T) {
+ for _, check := range []string{"-c", "-clip"} {
+ options := ParseArgs(check)
+ if !options.Clip {
+ t.Error("clip should be set")
+ }
+ }
+}
+
+func TestMultiArg(t *testing.T) {
+ for _, check := range []string{"-m", "-multi"} {
+ options := ParseArgs(check)
+ if !options.Multi {
+ t.Error("multi should be set")
+ }
+ }
+}
+
+func TestListArg(t *testing.T) {
+ for _, check := range []string{"-list", "-ls"} {
+ options := ParseArgs(check)
+ if !options.List {
+ t.Error("list should be set")
+ }
+ }
+}
+
+func TestOnce(t *testing.T) {
+ if options := ParseArgs("-once"); !options.Once {
+ t.Error("once should be set")
+ }
+}
+
+func TestShort(t *testing.T) {
+ if options := ParseArgs("-short"); !options.Short {
+ t.Error("short should be set")
+ }
+}
+
+func TestYes(t *testing.T) {
+ if options := ParseArgs("-yes"); !options.Yes {
+ t.Error("yes should be set")
+ }
+}