mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-11-10 13:04:03 +03:00
Fix failing test
This commit is contained in:
parent
1fa1a478d9
commit
73a055fe12
@ -40,7 +40,7 @@ func TestGraphicsCommandSerialization(t *testing.T) {
|
||||
data := c.AsAPC([]byte(payload))
|
||||
encoded := strings.Builder{}
|
||||
compressed := false
|
||||
var data_size uint64
|
||||
is_first := true
|
||||
for {
|
||||
idx := strings.Index(data, "\033_")
|
||||
if idx < 0 {
|
||||
@ -50,9 +50,9 @@ func TestGraphicsCommandSerialization(t *testing.T) {
|
||||
apc := data[idx+2 : l]
|
||||
data = data[l+2:]
|
||||
g := GraphicsCommandFromAPC([]byte(apc))
|
||||
if data_size == 0 {
|
||||
data_size = g.DataSize()
|
||||
if is_first {
|
||||
compressed = g.Compression() != 0
|
||||
is_first = false
|
||||
}
|
||||
encoded.WriteString(g.ResponseMessage())
|
||||
if g.m == GRT_more_nomore {
|
||||
@ -66,9 +66,6 @@ func TestGraphicsCommandSerialization(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("Encoded data not valid base-64 with error: %v", err)
|
||||
}
|
||||
if data_size > 0 && uint64(len(decoded)) != data_size {
|
||||
t.Fatalf("Data size %d != decoded size %d", data_size, len(decoded))
|
||||
}
|
||||
if compressed {
|
||||
b := bytes.Buffer{}
|
||||
b.Write(decoded)
|
||||
|
Loading…
Reference in New Issue
Block a user