Debian Codegraph @

internal/inst/types_test.go

raw symbols SCIP
1 package inst
2
3 import (
4 "reflect"
5 "testing"
6 )
7
8 func TestFormSupportedSuffixes(t *testing.T) {
9 cases := []struct {
10 Form Form
11 Expect []Suffixes
12 }{
13 {
14 Form: Form{},
15 Expect: []Suffixes{
16 {},
17 },
18 },
19 {
20 Form: Form{
21 Broadcast: true,
22 },
23 Expect: []Suffixes{
24 {BCST},
25 },
26 },
27 {
28 Form: Form{
29 EmbeddedRounding: true,
30 },
31 Expect: []Suffixes{
32 {RN_SAE},
33 {RZ_SAE},
34 {RD_SAE},
35 {RU_SAE},
36 },
37 },
38 {
39 Form: Form{
40 SuppressAllExceptions: true,
41 },
42 Expect: []Suffixes{
43 {SAE},
44 },
45 },
46 {
47 Form: Form{
48 Zeroing: true,
49 },
50 Expect: []Suffixes{
51 {Z},
52 },
53 },
54 {
55 Form: Form{
56 EmbeddedRounding: true,
57 Zeroing: true,
58 },
59 Expect: []Suffixes{
60 {RN_SAE, Z},
61 {RZ_SAE, Z},
62 {RD_SAE, Z},
63 {RU_SAE, Z},
64 },
65 },
66 {
67 Form: Form{
68 Broadcast: true,
69 Zeroing: true,
70 },
71 Expect: []Suffixes{
72 {BCST, Z},
73 },
74 },
75 }
76 for _, c := range cases {
77 got := c.Form.SupportedSuffixes()
78 if !reflect.DeepEqual(c.Expect, got) {
79 t.Errorf("%v.SupportedSuffixes() = %v; expect %v", c.Form, got, c.Expect)
80 }
81 }
82 }