viewpoint-core 0.4.3

High-level browser automation API for Viewpoint
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use super::*;

#[test]
fn test_credentials_origin_matching() {
    // No origin restriction
    let creds = HttpCredentials::new("user", "pass");
    assert!(creds.matches_origin("example.com"));
    assert!(creds.matches_origin("other.com"));

    // With origin restriction
    let creds = HttpCredentials::for_origin("user", "pass", "example.com");
    assert!(creds.matches_origin("example.com"));
    assert!(creds.matches_origin("sub.example.com"));
    assert!(!creds.matches_origin("other.com"));
    assert!(!creds.matches_origin("notexample.com"));
}