test(middleware): update bypass and rule tests

This commit is contained in:
yusing
2025-09-14 00:05:05 +08:00
parent 4ed6c7c74d
commit d1476edf91
2 changed files with 26 additions and 4 deletions

View File

@@ -42,7 +42,7 @@ func TestParseCommands(t *testing.T) {
// serve tests
{
name: "serve_valid",
input: "serve /var/www",
input: "serve /",
wantErr: nil,
},
{
@@ -50,6 +50,11 @@ func TestParseCommands(t *testing.T) {
input: "serve ",
wantErr: ErrInvalidArguments,
},
{
name: "serve_non_exist_path",
input: "serve /non-exist-path",
wantErr: ErrInvalidArguments,
},
{
name: "serve_too_many_args",
input: "serve / / /",