added emoji test

This commit is contained in:
Josh Baker 2017-04-09 19:40:55 -07:00
parent 01736e2faf
commit 20d521de6e
1 changed files with 11 additions and 0 deletions

View File

@ -63,6 +63,17 @@ func TestRandomValidStrings(t *testing.T) {
} }
} }
} }
func TestEmoji(t *testing.T) {
const input = `{"utf8":"Example emoji, KO: \ud83d\udd13, \ud83c\udfc3 OK: \u2764\ufe0f "}`
value := Get(input, "utf8")
var s string
json.Unmarshal([]byte(value.Raw), &s)
if value.String() != s {
t.Fatalf("expected '%v', got '%v'", s, value.String())
}
}
func testEscapePath(t *testing.T, json, path, expect string) { func testEscapePath(t *testing.T, json, path, expect string) {
if Get(json, path).String() != expect { if Get(json, path).String() != expect {
t.Fatalf("expected '%v', got '%v'", expect, Get(json, path).String()) t.Fatalf("expected '%v', got '%v'", expect, Get(json, path).String())