Debian Codegraph @

cty/primitive_type_test.go

raw symbols SCIP
1 package ctyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/
2
3 import (
4 "fmtscip-go gomod github.com/golang/go/src go1.18 fmt/"
5 "testingscip-go gomod github.com/golang/go/src go1.18 testing/"
6 )
7
8 func TestTypeIsPrimitiveTypescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/TestTypeIsPrimitiveType().(t *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Tscip-go gomod github.com/golang/go/src go1.18 testing/T#) {
9 tests := []struct {
10 Type Typescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Type#
11 Want bool
12 }{
13 {Stringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/String., true},
14 {Numberscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Number., true},
15 {Boolscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Bool., true},
16 {DynamicPseudoTypescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/DynamicPseudoType., false},
17 {Listscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/List().(Stringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/String.), false},
18
19 // Make sure our primitive constants are correctly constructed
20 {Truescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/True..Typescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#Type().(), true},
21 {Falsescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/False..Typescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#Type().(), true},
22 {Zeroscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Zero..Typescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#Type().(), true},
23 {PositiveInfinityscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/PositiveInfinity..Typescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#Type().(), true},
24 {NegativeInfinityscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/NegativeInfinity..Typescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#Type().(), true},
25 }
26
27 for i, test := range tests {
28 t.Runscip-go gomod github.com/golang/go/src go1.18 testing/T#Run().(fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.18 fmt/Sprintf().("%d %#v", i, test.Type), func(t *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Tscip-go gomod github.com/golang/go/src go1.18 testing/T#) {
29 got := test.Type.IsPrimitiveTypescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Type#IsPrimitiveType().()
30 if got != test.Want {
31 t.Errorfscip-go gomod github.com/golang/go/src go1.18 testing/common#Errorf().(
32 "wrong result\ntype: %#v\ngot: %#v\nwant: %#v",
33 test.Type,
34 test.Want, got,
35 )
36 }
37 })
38 }
39 }