(t *testing.T)
| 309 | } |
| 310 | |
| 311 | func TestCheckedExprToAstConstantExpr(t *testing.T) { |
| 312 | stdEnv, err := NewEnv() |
| 313 | if err != nil { |
| 314 | t.Fatalf("NewEnv() failed: %v", err) |
| 315 | } |
| 316 | in := "10" |
| 317 | ast, iss := stdEnv.Compile(in) |
| 318 | if iss.Err() != nil { |
| 319 | t.Fatalf("stdEnv.Compile(%q) failed: %v", in, iss.Err()) |
| 320 | } |
| 321 | expr, err := AstToCheckedExpr(ast) |
| 322 | if err != nil { |
| 323 | t.Fatalf("AstToCheckedExpr(ast) failed: %v", err) |
| 324 | } |
| 325 | ast2 := CheckedExprToAst(expr) |
| 326 | if !proto.Equal(ast2.Expr(), ast.Expr()) { |
| 327 | t.Fatalf("got ast %v, wanted %v", ast2, ast) |
| 328 | } |
| 329 | } |
| 330 | |
| 331 | func TestCheckedExprToAstMissingInfo(t *testing.T) { |
| 332 | stdEnv, err := NewEnv() |
nothing calls this directly
no test coverage detected