github.com/StackExchange/DNSControl@v0.2.8/providers/route53/route53Provider_test.go (about)

     1  package route53
     2  
     3  import "testing"
     4  
     5  func TestUnescape(t *testing.T) {
     6  	var tests = []struct {
     7  		experiment, expected string
     8  	}{
     9  		{"foo", "foo"},
    10  		{"foo.", "foo"},
    11  		{"foo..", "foo."},
    12  		{"foo...", "foo.."},
    13  		{`\052`, "*"},
    14  		{`\052.foo..`, "*.foo."},
    15  		// {`\053.foo`, "+.foo"},  // Not implemented yet.
    16  	}
    17  
    18  	for i, test := range tests {
    19  		actual := unescape(&test.experiment)
    20  		if test.expected != actual {
    21  			t.Errorf("%d: Expected %s, got %s", i, test.expected, actual)
    22  		}
    23  	}
    24  }