File tree Expand file tree Collapse file tree 3 files changed +21
-5
lines changed
Expand file tree Collapse file tree 3 files changed +21
-5
lines changed Original file line number Diff line number Diff line change 77 rm -rf target
88
99test :
10- cargo test
10+ cargo test -- --nocapture
1111
1212valid :
1313 cargo fmt --all
1717 cargo fmt --all -- --check
1818 cargo clippy --all-targets --all-features -- -D warnings
1919
20- .PHONY : build-fst clean test valid check
20+ doc :
21+ cargo doc --open
22+
23+ .PHONY : build-fst clean test valid check doc
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ See https://aboutcode.org for more information about nexB OSS projects.
99
1010*/
1111
12-
1312use fst:: SetBuilder ;
1413use std:: fs:: File ;
1514use std:: io:: { BufRead , BufReader } ;
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ See https://aboutcode.org for more information about nexB OSS projects.
99
1010*/
1111
12-
1312use super :: * ;
1413use std:: path:: Path ;
1514
@@ -18,6 +17,21 @@ fn test_validate_with_custom_file() {
1817 let test_path = Path :: new ( env ! ( "CARGO_MANIFEST_DIR" ) ) . join ( "tests/data/test_purls.fst" ) ;
1918 let validator = load_fst ( & test_path) ;
2019
20+ assert ! ( strip_and_check_purl(
21+ "pkg:nuget/FluentUtils.EnumExtensions" ,
22+ & validator
23+ ) ) ;
24+ assert ! ( !strip_and_check_purl( "pkg:example/nonexistent" , & validator) ) ;
25+ }
26+
27+ #[ test]
28+ fn test_validate_with_packageurl_trailing_slash ( ) {
29+ let test_path = Path :: new ( env ! ( "CARGO_MANIFEST_DIR" ) ) . join ( "tests/data/test_purls.fst" ) ;
30+ let validator = load_fst ( & test_path) ;
31+
2132 assert ! ( validator. contains( "pkg:nuget/FluentUtils.EnumExtensions" ) ) ;
22- assert ! ( !validator. contains( "pkg:example/nonexistent" ) ) ;
33+ assert ! ( strip_and_check_purl(
34+ "pkg:nuget/FluentUtils.EnumExtensions/" ,
35+ & validator
36+ ) ) ;
2337}
You can’t perform that action at this time.
0 commit comments