File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
crates/spk-schema/crates/foundation/src/name Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,23 @@ fn test_opt_name_validation(#[case] input: &str) {
3535 super :: validate_opt_name ( input) . unwrap ( ) ;
3636}
3737
38+ #[ rstest]
39+ #[ case( "lowercase" , "lowercase" ) ]
40+ #[ case( "with-dashes" , "with-dashes" ) ]
41+ #[ case( "with_underscores" , "with_underscores" ) ]
42+ #[ case( "num000" , "num000" ) ]
43+ #[ case( "000-000" , "000-000" ) ]
44+ #[ case( "000_000" , "000_000" ) ]
45+ #[ case( "-----" , "-----" ) ]
46+ #[ case( "_____" , "_____" ) ]
47+ #[ case( "upperCase" , "uppercase" ) ]
48+ #[ case( "name!!" , "name" ) ]
49+ #[ case( "a" , "a_" ) ]
50+ fn test_opt_name_buf_new_lossy ( #[ case] input : & str , #[ case] result : & str ) {
51+ let opt_name = super :: OptNameBuf :: new_lossy ( & String :: from ( input) ) ;
52+ assert_eq ! ( opt_name. base_name( ) , result) ;
53+ }
54+
3855#[ rstest]
3956#[ case( "my_opt" , None , "my_opt" ) ]
4057#[ case( "my-pkg.my_opt" , Some ( "my-pkg" ) , "my_opt" ) ]
You can’t perform that action at this time.
0 commit comments