Fix failing test

This commit is contained in:
Kovid Goyal 2022-08-25 14:22:16 +05:30
parent c86f8a698c
commit a22ba9f739
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -56,7 +56,7 @@ func TestRCSerialization(t *testing.T) {
t.Fatalf("Incorrect serialization: %s != %s", expected, as) t.Fatalf("Incorrect serialization: %s != %s", expected, as)
} }
} }
simple(`{"cmd":"test","version":[1,2,3]}`) simple(string(wrap_in_escape_code([]byte(`{"cmd":"test","version":[1,2,3]}`))))
pubkey_b, _, err := crypto.KeyPair("1") pubkey_b, _, err := crypto.KeyPair("1")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
@ -70,6 +70,7 @@ func TestRCSerialization(t *testing.T) {
t.Fatal(err) t.Fatal(err)
} }
raw, err := io_data.serializer(&rc) raw, err := io_data.serializer(&rc)
raw = raw[len("\x1bP@kitty-cmd") : len(raw)-2]
var ec utils.EncryptedRemoteControlCmd var ec utils.EncryptedRemoteControlCmd
err = json.Unmarshal([]byte(raw), &ec) err = json.Unmarshal([]byte(raw), &ec)
if err != nil { if err != nil {