mirror of
https://github.com/zyedidia/micro.git
synced 2025-06-19 07:15:34 -04:00
Improve unicode line array test
This commit is contained in:
parent
9a22d93ea2
commit
0064b8268f
@ -46,14 +46,15 @@ func TestInsert(t *testing.T) {
|
|||||||
|
|
||||||
assert.Equal(t, []byte("Uppen Sevarne staþe, foobar sel þar him þuhte,"), sub1)
|
assert.Equal(t, []byte("Uppen Sevarne staþe, foobar sel þar him þuhte,"), sub1)
|
||||||
|
|
||||||
la.insert(Loc{25, 2}, []byte("ಮಣ್ಣಾಗಿ"))
|
la.insert(Loc{25, 2}, []byte("H̼̥̯͇͙̕͘͞e̸̦̞̠̣̰͙̼̥̦̼̖̬͕͕̰̯̫͇̕ĺ̜̠̩̯̯͙̼̭̠͕̮̞͜l̶͓̫̞̮͈͞ͅo̸͔͙̳̠͈̮̼̳͙̥̲͜͠"))
|
||||||
|
|
||||||
sub2 := la.Substr(Loc{0, 2}, Loc{60, 2})
|
sub2 := la.Substr(Loc{0, 2}, Loc{60, 2})
|
||||||
assert.Equal(t, []byte("He wonede at Ernleȝe at æಮಣ್ಣಾಗಿðelen are chirechen,"), sub2)
|
assert.Equal(t, []byte("He wonede at Ernleȝe at æH̼̥̯͇͙̕͘͞e̸̦̞̠̣̰͙̼̥̦̼̖̬͕͕̰̯̫͇̕ĺ̜̠̩̯̯͙̼̭̠͕̮̞͜l̶͓̫̞̮͈͞ͅo̸͔͙̳̠͈̮̼̳͙̥̲͜͠ðelen are chirechen,"), sub2)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestRemove(t *testing.T) {
|
func TestRemove(t *testing.T) {
|
||||||
la.remove(Loc{20, 3}, Loc{27, 3})
|
la.remove(Loc{20, 3}, Loc{27, 3})
|
||||||
la.remove(Loc{25, 2}, Loc{32, 2})
|
la.remove(Loc{25, 2}, Loc{30, 2})
|
||||||
|
|
||||||
bytes := la.Bytes()
|
bytes := la.Bytes()
|
||||||
assert.Equal(t, unicode_txt, string(bytes))
|
assert.Equal(t, unicode_txt, string(bytes))
|
||||||
|
Loading…
Reference in New Issue
Block a user