Skip to content

Commit

Permalink
test: short chinese text formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
bashbunni committed Aug 14, 2023
1 parent 441a859 commit 6c6714f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
8 changes: 7 additions & 1 deletion glamour_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,12 @@ func TestWrapping(t *testing.T) {
mdpath: "testdata/issues/42.md",
goldpath: "testdata/issues/42.test",
},
{
name: "chinese short",
locale: "C.UTF-8",
mdpath: "testdata/issues/short-chinese-text.md",
goldpath: "testdata/issues/short-chinese-text.test",
},
{
name: "chinese long",
locale: "C.UTF-8",
Expand Down Expand Up @@ -270,7 +276,7 @@ func TestWrapping(t *testing.T) {
}

if diff := cmp.Diff(string(got), string(want)); diff != "" {
t.Fatalf("got != want\n-want +got:\ndiff:\n%s", string(diff))
t.Fatalf("got != want\n-want +got:\ndiff:\n%s", diff)
}
})
}
Expand Down
1 change: 1 addition & 0 deletions testdata/issues/short-chinese-text.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
李绅 《悯农》锄禾日当午,汗滴禾下土。谁知盘中餐,粒粒皆辛苦。床前明月光,疑是地上霜。举头望明月,低头思故乡。
4 changes: 4 additions & 0 deletions testdata/issues/short-chinese-text.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

 李绅                                                                        
 《悯农》锄禾日当午,汗滴禾下土。谁知盘中餐,粒粒皆辛苦。床前明月光,疑是地上霜。举头望明月,低头思故乡。

0 comments on commit 6c6714f

Please sign in to comment.