(t *testing.T)
| 395 | } |
| 396 | |
| 397 | func TestRawExpressionCreateAst(t *testing.T) { |
| 398 | t.Run("test raw expression create ast", func(t *testing.T) { |
| 399 | envOpt := EnvironmentFile("testdata/config.yaml") |
| 400 | compiler, err := NewCompiler(envOpt) |
| 401 | if err != nil { |
| 402 | t.Fatalf("NewCompiler() failed: %v", err) |
| 403 | } |
| 404 | rawExpr := &RawExpression{ |
| 405 | Value: "locationCode(destination.ip)==locationCode(origin.ip)", |
| 406 | } |
| 407 | ast, _, err := rawExpr.CreateAST(compiler) |
| 408 | if err != nil { |
| 409 | t.Fatalf("CreateAST() failed: %v", err) |
| 410 | } |
| 411 | if ast == nil { |
| 412 | t.Fatalf("CreateAST() returned nil ast") |
| 413 | } |
| 414 | }) |
| 415 | } |
nothing calls this directly
no test coverage detected