mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-27 18:51:41 +02:00
Add support for more option types to Go conf file parsing
This commit is contained in:
26
tools/config/utils_test.go
Normal file
26
tools/config/utils_test.go
Normal file
@@ -0,0 +1,26 @@
|
||||
// License: GPLv3 Copyright: 2023, Kovid Goyal, <kovid at kovidgoyal.net>
|
||||
|
||||
package config
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
var _ = fmt.Print
|
||||
|
||||
func TestStringLiteralParsing(t *testing.T) {
|
||||
for q, expected := range map[string]string{
|
||||
`abc`: `abc`,
|
||||
`a\nb\M`: "a\nb\\M",
|
||||
`a\x20\x1\u1234\123\12|`: "a \\x1\u1234\123\x0a|",
|
||||
} {
|
||||
actual, err := StringLiteral(q)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if expected != actual {
|
||||
t.Fatalf("Failed with input: %#v\n%#v != %#v", q, expected, actual)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user