-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrunner_test.go
More file actions
47 lines (39 loc) · 838 Bytes
/
runner_test.go
File metadata and controls
47 lines (39 loc) · 838 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright 2025 variHQ OÜ
// SPDX-License-Identifier: BSD-3-Clause
package spark_test
import (
"reflect"
"testing"
"github.com/wakeful/spark"
)
func Test_runnerType_MarshalJSON(t *testing.T) {
t.Parallel()
tests := []struct {
name string
i spark.RunnerType
want []byte
wantErr bool
}{
{
name: "runType(0)",
i: 0,
want: []byte{
34, 82, 117, 110, 110, 101, 114, 84, 121, 112, 101, 40, 48, 41, 34,
},
wantErr: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
got, err := tt.i.MarshalJSON()
if (err != nil) != tt.wantErr {
t.Errorf("MarshalJSON() error = %v, wantErr %v", err, tt.wantErr)
return
}
if !reflect.DeepEqual(got, tt.want) {
t.Errorf("MarshalJSON() got = %v, want %v", got, tt.want)
}
})
}
}