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 d6cd4ba
Show file tree
Hide file tree
Showing 3 changed files with 27 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
9 changes: 9 additions & 0 deletions testdata/issues/short-chinese-text.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
李绅 《悯农》

锄禾日当午,

汗滴禾下土。

谁知盘中餐,

粒粒皆辛苦。
11 changes: 11 additions & 0 deletions testdata/issues/short-chinese-text.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

 李绅 《悯农》                                                               
                                                                            
 锄禾日当午,                                                                
                                                                            
 汗滴禾下土。                                                                
                                                                            
 谁知盘中餐,                                                                
                                                                            
 粒粒皆辛苦。                                                                

0 comments on commit d6cd4ba

Please sign in to comment.