| 128 | } |
| 129 | |
| 130 | func TestScopeFinalize(t *testing.T) { |
| 131 | var ( |
| 132 | root = NewScope() |
| 133 | sub1 = root.SubScope("x") |
| 134 | sub2 = sub1.SubScope("y") |
| 135 | ) |
| 136 | if _, err := sub1.Finalize(); err != nil { |
| 137 | t.Fatal(err) |
| 138 | } |
| 139 | if err := root.Err(); err == nil { |
| 140 | t.Error("Root scope's Err() should be non-nil once Finalize has been called") |
| 141 | } |
| 142 | if err := sub2.Err(); err == nil { |
| 143 | t.Error("Sub scope's Err() should be non-nil once Finalize has been called") |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | func TestMultipleGeneratedOps(t *testing.T) { |
| 148 | s := NewScope() |