mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +01:00
Add path_match tests
This commit is contained in:
parent
f8d906be10
commit
d332557d69
1 changed files with 17 additions and 0 deletions
|
@ -25,6 +25,23 @@ fn test_domain_match() {
|
||||||
assert!(!Cookie::domain_match("235.132.2.3", ".2.3"));
|
assert!(!Cookie::domain_match("235.132.2.3", ".2.3"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_path_match() {
|
||||||
|
assert!(Cookie::path_match("/", "/"));
|
||||||
|
assert!(Cookie::path_match("/index.html", "/"));
|
||||||
|
assert!(Cookie::path_match("/w/index.html", "/"));
|
||||||
|
assert!(Cookie::path_match("/w/index.html", "/w/index.html"));
|
||||||
|
assert!(Cookie::path_match("/w/index.html", "/w/"));
|
||||||
|
assert!(Cookie::path_match("/w/index.html", "/w"));
|
||||||
|
|
||||||
|
assert!(!Cookie::path_match("/", "/w/"));
|
||||||
|
assert!(!Cookie::path_match("/a", "/w/"));
|
||||||
|
assert!(!Cookie::path_match("/", "/w"));
|
||||||
|
assert!(!Cookie::path_match("/w/index.html", "/w/index"));
|
||||||
|
assert!(!Cookie::path_match("/windex.html", "/w/"));
|
||||||
|
assert!(!Cookie::path_match("/windex.html", "/w"));
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_default_path() {
|
fn test_default_path() {
|
||||||
assert!(&*Cookie::default_path("/foo/bar/baz/") == "/foo/bar/baz");
|
assert!(&*Cookie::default_path("/foo/bar/baz/") == "/foo/bar/baz");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue