aboutsummaryrefslogtreecommitdiff
path: root/plugin/auto/regexp_test.go
blob: 17c35eb90c3813bd74595588c625ffce16424b04 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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)
		}
	}
}