(t *testing.T)
| 94 | } |
| 95 | |
| 96 | func TestAppendToLower(t *testing.T) { |
| 97 | tests := []string{ |
| 98 | "", |
| 99 | "A", |
| 100 | "a", |
| 101 | "__segment_internal", |
| 102 | "someFieldWithALongBName", |
| 103 | "Hello World!", |
| 104 | "Hello\"World!", |
| 105 | "Hello\\World!", |
| 106 | "Hello\nWorld!", |
| 107 | "Hello\rWorld!", |
| 108 | "Hello\tWorld!", |
| 109 | "Hello\bWorld!", |
| 110 | "Hello\fWorld!", |
| 111 | "你好", |
| 112 | "<", |
| 113 | ">", |
| 114 | "&", |
| 115 | "\u001944", |
| 116 | "\u00c2e>", |
| 117 | "\u00c2V?", |
| 118 | "\u000e=8", |
| 119 | "\u001944\u00c2e>\u00c2V?\u000e=8", |
| 120 | "ir\u001bQJ\u007f\u0007y\u0015)", |
| 121 | } |
| 122 | |
| 123 | for _, test := range tests { |
| 124 | s1 := strings.ToLower(test) |
| 125 | s2 := string(appendToLower(nil, []byte(test))) |
| 126 | |
| 127 | if s1 != s2 { |
| 128 | t.Error("lowercase values mismatch") |
| 129 | t.Log("expected:", s1) |
| 130 | t.Log("found: ", s2) |
| 131 | } |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | func BenchmarkParseString(b *testing.B) { |
| 136 | s := []byte(`"__segment_internal"`) |
nothing calls this directly
no test coverage detected
searching dependent graphs…