diff options
Diffstat (limited to 'plugin/auto/regexp_test.go')
-rw-r--r-- | plugin/auto/regexp_test.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/plugin/auto/regexp_test.go b/plugin/auto/regexp_test.go new file mode 100644 index 000000000..17c35eb90 --- /dev/null +++ b/plugin/auto/regexp_test.go @@ -0,0 +1,20 @@ +package auto + +import "testing" + +func TestRewriteToExpand(t *testing.T) { + tests := []struct { + in string + expected string + }{ + {in: "", expected: ""}, + {in: "{1}", expected: "${1}"}, + {in: "{1", expected: "${1"}, + } + for i, tc := range tests { + got := rewriteToExpand(tc.in) + if got != tc.expected { + t.Errorf("Test %d: Expected error %v, but got %v", i, tc.expected, got) + } + } +} |