Skip to content

Commit b8a257e

Browse files
committed
test: add regression tests on Action JSON methods
1 parent cadb6f7 commit b8a257e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

scm/const_test.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,24 @@ func TestStateJSON(t *testing.T) {
2525
})
2626
}
2727
}
28+
29+
func TestActionJSON(t *testing.T) {
30+
for i := ActionCreate; i < ActionCompleted; i++ {
31+
in := i
32+
t.Run(in.String(), func(t *testing.T) {
33+
b, err := json.Marshal(in)
34+
if err != nil {
35+
t.Fatal(err)
36+
}
37+
38+
var out Action
39+
if err := json.Unmarshal(b, &out); err != nil {
40+
t.Fatal(err)
41+
}
42+
43+
if in != out {
44+
t.Errorf("%s != %s", in, out)
45+
}
46+
})
47+
}
48+
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy