Disallow incorrect wrapping range expression for --nth

This commit is contained in:
Junegunn Choi
2025-01-15 22:39:48 +09:00
parent 9d6637c1b3
commit 717562b264
2 changed files with 13 additions and 1 deletions

View File

@@ -40,6 +40,18 @@ func TestParseRange(t *testing.T) {
t.Errorf("%v", r)
}
}
{
i := "1..3..5"
if r, ok := ParseRange(&i); ok {
t.Errorf("%v", r)
}
}
{
i := "-3..3"
if r, ok := ParseRange(&i); ok {
t.Errorf("%v", r)
}
}
}
func TestTokenize(t *testing.T) {