1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package adt
16
17 import (
18 "fmt"
19 "testing"
20 )
21
22 func TestNilSource(t *testing.T) {
23 testCases := []Node{
24 &BasicType{},
25 &BinaryExpr{},
26 &Bool{},
27 &Bottom{},
28 &BoundExpr{},
29 &BoundValue{},
30 &Builtin{},
31 &BuiltinValidator{},
32 &BulkOptionalField{},
33 &Bytes{},
34 &CallExpr{},
35 &Comprehension{},
36 &Conjunction{},
37 &Disjunction{},
38 &DisjunctionExpr{},
39 &DynamicField{},
40 &DynamicReference{},
41 &Ellipsis{},
42 &Field{},
43 &FieldReference{},
44 &ForClause{},
45 &IfClause{},
46 &ImportReference{},
47 &IndexExpr{},
48 &Interpolation{},
49 &LabelReference{},
50 &LetClause{},
51 &LetField{},
52 &LetReference{},
53 &ListLit{},
54 &ListMarker{},
55 &NodeLink{},
56 &Null{},
57 &Num{},
58 &SelectorExpr{},
59 &SliceExpr{},
60 &String{},
61 &StructLit{},
62 &StructMarker{},
63 &Top{},
64 &UnaryExpr{},
65 &Vertex{},
66 }
67 for _, x := range testCases {
68 t.Run(fmt.Sprintf("%T", x), func(t *testing.T) {
69 if x.Source() != nil {
70 t.Error("nil source did not return nil")
71 }
72 })
73 }
74 }
75
View as plain text