package exec

import (
	"encoding/json"
	"testing"
)

func errIsCode(t *testing.T, err error, code ErrorCode) {
	t.Helper()
	if err == nil {
		t.Fatalf("expected %s error", code)
	}
	if got := classify(err).Code; got != code {
		t.Fatalf("error code = %s, want %s: %v", got, code, err)
	}
}

func jsonRaw(value string) json.RawMessage { return json.RawMessage(value) }
