(t *testing.T)
| 42 | } |
| 43 | |
| 44 | func TestCopyDeclarations(t *testing.T) { |
| 45 | src := common.NewTextSource(`1 + 2 != 3 - 4`) |
| 46 | parsedAst, errors := parser.Parse(src) |
| 47 | if len(errors.GetErrors()) > 0 { |
| 48 | t.Fatalf("Unexpected parse errors: %v", errors.ToDisplayString()) |
| 49 | } |
| 50 | |
| 51 | env := newStdEnv(t) |
| 52 | _, errors = Check(parsedAst, src, env) |
| 53 | if len(errors.GetErrors()) > 0 { |
| 54 | t.Fatalf("Check(parsedAst, src, env): %v", errors.ToDisplayString()) |
| 55 | } |
| 56 | |
| 57 | copy, err := NewEnv(containers.DefaultContainer, newTestRegistry(t), ValidatedDeclarations(env)) |
| 58 | if err != nil { |
| 59 | t.Fatalf("NewEnv(container, registry, CopyDeclarations(env)) failed %v: ", err) |
| 60 | } |
| 61 | _, errors = Check(parsedAst, src, copy) |
| 62 | if len(errors.GetErrors()) > 0 { |
| 63 | t.Fatalf("Check(parsedAst, src, copy): %v", errors.ToDisplayString()) |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | func BenchmarkNewStdEnv(b *testing.B) { |
| 68 | for i := 0; i < b.N; i++ { |
nothing calls this directly
no test coverage detected