Simplify module cleanup paths
This commit is contained in:
@@ -121,6 +121,22 @@ func TestPlanRejectsInvalidOptions(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestDecodeOptionsRejectsNonNativeIntegers(t *testing.T) {
|
||||
for _, value := range []any{
|
||||
int8(2), int16(2), int32(2), int64(2),
|
||||
uint(2), uint8(2), uint16(2), uint32(2), uint64(2),
|
||||
float32(2), float64(2), json.Number("2"),
|
||||
} {
|
||||
_, err := DecodeOptions(map[string]any{"max_units": value})
|
||||
if err == nil {
|
||||
t.Fatalf("DecodeOptions(max_units: %T) error = nil, want error", value)
|
||||
}
|
||||
if !strings.Contains(err.Error(), "max_units must be an integer") {
|
||||
t.Fatalf("DecodeOptions(max_units: %T) error = %q, want integer type error", value, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestPlanRejectsEmptySource(t *testing.T) {
|
||||
doc := testSource(1)
|
||||
doc.Units = nil
|
||||
|
||||
Reference in New Issue
Block a user