Skip to content

Commit

Permalink
add TestGetTypeSymbols
Browse files Browse the repository at this point in the history
  • Loading branch information
issadarkthing committed Mar 21, 2021
1 parent 6ea9d4f commit e4c5376
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions env/envTypes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,3 +311,30 @@ func TestDefineTypeFail(t *testing.T) {
}
}
}

func TestGetTypeSymbols(t *testing.T) {
var symbols []string
values := map[string]interface{}{
"a": int64(1),
"b": float64(1),
"c": true,
"d": "a",
}

env := NewEnv()
for s, v := range values {
env.DefineType(s, v)
}

symbols = env.GetTypeSymbols()
if len(symbols) != len(values) {
t.Errorf("Expected %d symbols, received %d", len(values), len(symbols))
}

for _, symbol := range symbols {
_, ok := values[symbol]
if !ok {
t.Errorf("Missing %s symbol", symbol)
}
}
}

0 comments on commit e4c5376

Please sign in to comment.