mirror of
				https://github.com/StackExchange/dnscontrol.git
				synced 2025-10-29 23:46:25 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			24 lines
		
	
	
	
		
			484 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
	
		
			484 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package route53
 | |
| 
 | |
| import "testing"
 | |
| 
 | |
| func TestUnescape(t *testing.T) {
 | |
| 	var tests = []struct {
 | |
| 		experiment, expected string
 | |
| 	}{
 | |
| 		{"foo", "foo"},
 | |
| 		{"foo.", "foo"},
 | |
| 		{"foo..", "foo."},
 | |
| 		{"foo...", "foo.."},
 | |
| 		{`\052`, "*"},
 | |
| 		{`\052.foo..`, "*.foo."},
 | |
| 		// {`\053.foo`, "+.foo"},  // Not implemented yet.
 | |
| 	}
 | |
| 
 | |
| 	for i, test := range tests {
 | |
| 		actual := unescape(&test.experiment)
 | |
| 		if test.expected != actual {
 | |
| 			t.Errorf("%d: Expected %s, got %s", i, test.expected, actual)
 | |
| 		}
 | |
| 	}
 | |
| }
 |