MustBuild panics on builder error.
(t *testing.T)
| 156 | |
| 157 | // MustBuild panics on builder error. |
| 158 | func TestBuilder_mustBuildPanicsOnError(t *testing.T) { |
| 159 | defer func() { |
| 160 | if r := recover(); r == nil { |
| 161 | t.Fatalf("MustBuild must panic when Build would fail") |
| 162 | } |
| 163 | }() |
| 164 | _ = platform.NewPlugin("BadName", "0").MustBuild() |
| 165 | } |
| 166 | |
| 167 | func TestBuilder_restrictNilRejected(t *testing.T) { |
| 168 | _, err := platform.NewPlugin("p", "0").Restrict(nil).Build() |