๐Ÿ“ฆ Turbo87 / hosted-git-info-rs

๐Ÿ“„ proptest.rs ยท 47 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47use crate::HostedGitInfo;
use proptest::prelude::*;

proptest! {
    #[test]
    #[allow(unused_must_use)]
    fn doesnt_crash(s in "\\PC*") {
        HostedGitInfo::from_url(&s);
    }

    #[test]
    #[allow(unused_must_use)]
    fn doesnt_crash_from_random_github_shortcut(s in "github:\\PC*") {
        HostedGitInfo::from_url(&s);
    }

    #[test]
    #[allow(unused_must_use)]
    fn doesnt_crash_from_random_github_url_with_no_protocol(s in "\\PC*@github.com:\\PC*") {
        HostedGitInfo::from_url(&s);
    }

    #[test]
    #[allow(unused_must_use)]
    fn doesnt_crash_from_random_gitlab_shortcut(s in "gitlab:\\PC*") {
        HostedGitInfo::from_url(&s);
    }

    #[test]
    #[allow(unused_must_use)]
    fn doesnt_crash_from_random_gitlab_url_with_no_protocol(s in "\\PC*@gitlab.com:\\PC*") {
        HostedGitInfo::from_url(&s);
    }

    #[test]
    #[allow(unused_must_use)]
    fn doesnt_crash_from_random_bitbucket_shortcut(s in "bitbucket:\\PC*") {
        HostedGitInfo::from_url(&s);
    }

    #[test]
    #[allow(unused_must_use)]
    fn doesnt_crash_from_random_bitbucket_url_with_no_protocol(s in "\\PC*@bitbucket.org:\\PC*") {
        HostedGitInfo::from_url(&s);
    }
}