File: raw_test.go

package info (click to toggle)
golang-github-digitalocean-go-qemu 0.0~git20250212.ee9b066-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 860 kB
  • sloc: sh: 34; makefile: 3
file content (19 lines) | stat: -rw-r--r-- 406 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package raw

import (
	"bytes"
	"testing"
)

func TestKeyValueQcode(t *testing.T) {
	key := QKeyCodeShift
	code := KeyValueQcode(key)
	json, err := code.MarshalJSON()
	expectedJSON := []byte(`{"data":"shift","type":"qcode"}`)
	if err != nil {
		t.Fatalf("Failed to marshall %v: %s", code, err)
	}
	if !bytes.Equal(json, expectedJSON) {
		t.Fatalf("Expected %s, but output was %s", expectedJSON, json)
	}
}