(t *testing.T)
| 4250 | } |
| 4251 | |
| 4252 | func TestOptionalHasValueVersion(t *testing.T) { |
| 4253 | env := testEnv(t, |
| 4254 | OptionalTypes(OptionalTypesVersion(2)), |
| 4255 | // Test variables. |
| 4256 | Variable("x", OptionalType(IntType)), |
| 4257 | ) |
| 4258 | if _, iss := env.Compile("x.hasValue()"); iss.Err() != nil { |
| 4259 | t.Errorf("hasValue() failed: %v", iss.Err()) |
| 4260 | } |
| 4261 | _, iss := env.Compile("x.hasValue(1)") |
| 4262 | if iss.Err() == nil || !strings.Contains(iss.Err().Error(), "no matching overload for 'hasValue'") { |
| 4263 | t.Errorf("hasValue(1) got an unexpected result: %v", iss.Err()) |
| 4264 | } |
| 4265 | env = testEnv(t, |
| 4266 | OptionalTypes(OptionalTypesVersion(3)), |
| 4267 | // Test variables. |
| 4268 | Variable("x", OptionalType(IntType)), |
| 4269 | ) |
| 4270 | if _, iss := env.Compile("x.hasValue(1)"); iss.Err() != nil { |
| 4271 | t.Errorf("hasValue(1) failed: %v", iss.Err()) |
| 4272 | } |
| 4273 | } |
| 4274 | |
| 4275 | func TestOptionalMapVersion(t *testing.T) { |
| 4276 | commonOpts := []EnvOption{ |
nothing calls this directly
no test coverage detected