(t *testing.T)
| 268 | } |
| 269 | |
| 270 | func TestCheckedExprToAstConstantExpr(t *testing.T) { |
| 271 | stdEnv, err := NewEnv() |
| 272 | if err != nil { |
| 273 | t.Fatalf("NewEnv() failed: %v", err) |
| 274 | } |
| 275 | in := "10" |
| 276 | ast, iss := stdEnv.Compile(in) |
| 277 | if iss.Err() != nil { |
| 278 | t.Fatalf("stdEnv.Compile(%q) failed: %v", in, iss.Err()) |
| 279 | } |
| 280 | expr, err := AstToCheckedExpr(ast) |
| 281 | if err != nil { |
| 282 | t.Fatalf("AstToCheckedExpr(ast) failed: %v", err) |
| 283 | } |
| 284 | ast2 := CheckedExprToAst(expr) |
| 285 | if !proto.Equal(ast2.Expr(), ast.Expr()) { |
| 286 | t.Fatalf("got ast %v, wanted %v", ast2, ast) |
| 287 | } |
| 288 | } |
| 289 | |
| 290 | func TestCheckedExprToAstMissingInfo(t *testing.T) { |
| 291 | stdEnv, err := NewEnv() |
nothing calls this directly
no test coverage detected