Skip to content

Commit

Permalink
Add the test for the unicode for Woman Facepalming
Browse files Browse the repository at this point in the history
U+1F926 U+200D U+2640 U+FE0F
https://emojipedia.org/woman-facepalming/
  • Loading branch information
hymkor committed Feb 27, 2021
1 parent f172f92 commit 944dc57
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions moji_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,19 @@ func TestCodePointPut(t *testing.T) {
t.Fatalf("string2moji(%v).WriteTo()='%s' (expect '%s')", source, result, source)
}
}

func TestWomanFacepalming(t *testing.T) {
SurrogatePairOk = true
ZeroWidthJoinSequenceOk = true
VariationSequenceOk = true

source := "\U0001F926\u200D\u2640\uFE0F"
mojis := string2moji(source)

if result := len(mojis); result != 1 {
t.Fatalf("len(string2moji(WOMAN FACEPALMING)) == %d (expect %d)", result, 1)
}
if result := mojis[0].Width(); result != 5 {
t.Fatalf("Width(WOMAN FACEPALMING)) == %d (expect %d)", result, 4)
}
}

0 comments on commit 944dc57

Please sign in to comment.