feat: Add path-only URI support
This commit is contained in:
@ -67,6 +67,58 @@ setup() {
|
||||
[ "$fragment" == '' ]
|
||||
}
|
||||
|
||||
@test "." {
|
||||
. uri.sh
|
||||
parse_uri '.'
|
||||
[ "$scheme" == 'file' ]
|
||||
[ "$hostname" == '' ]
|
||||
[ "$port" == '' ]
|
||||
[ "$path" == '.' ]
|
||||
[ "$username" == '' ]
|
||||
[ "$password" == '' ]
|
||||
[ "$query" == '' ]
|
||||
[ "$fragment" == '' ]
|
||||
}
|
||||
|
||||
@test "./relative/path" {
|
||||
. uri.sh
|
||||
parse_uri './relative/path'
|
||||
[ "$scheme" == 'file' ]
|
||||
[ "$hostname" == '' ]
|
||||
[ "$port" == '' ]
|
||||
[ "$path" == './relative/path' ]
|
||||
[ "$username" == '' ]
|
||||
[ "$password" == '' ]
|
||||
[ "$query" == '' ]
|
||||
[ "$fragment" == '' ]
|
||||
}
|
||||
|
||||
@test "../relative/path" {
|
||||
. uri.sh
|
||||
parse_uri '../relative/path'
|
||||
[ "$scheme" == 'file' ]
|
||||
[ "$hostname" == '' ]
|
||||
[ "$port" == '' ]
|
||||
[ "$path" == '../relative/path' ]
|
||||
[ "$username" == '' ]
|
||||
[ "$password" == '' ]
|
||||
[ "$query" == '' ]
|
||||
[ "$fragment" == '' ]
|
||||
}
|
||||
|
||||
@test "/abs/path" {
|
||||
. uri.sh
|
||||
parse_uri '/abs/path'
|
||||
[ "$scheme" == 'file' ]
|
||||
[ "$hostname" == '' ]
|
||||
[ "$port" == '' ]
|
||||
[ "$path" == '/abs/path' ]
|
||||
[ "$username" == '' ]
|
||||
[ "$password" == '' ]
|
||||
[ "$query" == '' ]
|
||||
[ "$fragment" == '' ]
|
||||
}
|
||||
|
||||
@test "sqlite:///path" {
|
||||
. uri.sh
|
||||
parse_uri 'sqlite:///path'
|
||||
|
Reference in New Issue
Block a user