File tree 1 file changed +48
-0
lines changed
1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -1801,3 +1801,51 @@ fn trim_paths_parsing() {
1801
1801
let trim_paths: TomlTrimPaths = gctx. get ( "profile.dev.trim-paths" ) . unwrap ( ) ;
1802
1802
assert_eq ! ( trim_paths, expected, "failed to parse {val}" ) ;
1803
1803
}
1804
+
1805
+ #[ cargo_test]
1806
+ fn git_features_env ( ) {
1807
+ let gctx = GlobalContextBuilder :: new ( )
1808
+ . env ( "CARGO_UNSTABLE_GIT" , "true" )
1809
+ . build ( ) ;
1810
+ verify ( gctx) ;
1811
+
1812
+ write_config_toml (
1813
+ "\
1814
+ [unstable.git]
1815
+ " ,
1816
+ ) ;
1817
+ let gctx = GlobalContextBuilder :: new ( ) . build ( ) ;
1818
+ verify ( gctx) ;
1819
+
1820
+ fn verify ( gctx : GlobalContext ) {
1821
+ assert_error (
1822
+ gctx. get :: < Option < cargo:: core:: CliUnstable > > ( "unstable" )
1823
+ . unwrap_err ( ) ,
1824
+ "missing field `shallow_index`" ,
1825
+ ) ;
1826
+ }
1827
+ }
1828
+
1829
+ #[ cargo_test]
1830
+ fn gitoxide_features_env ( ) {
1831
+ let gctx = GlobalContextBuilder :: new ( )
1832
+ . env ( "CARGO_UNSTABLE_GITOXIDE" , "true" )
1833
+ . build ( ) ;
1834
+ verify ( gctx) ;
1835
+
1836
+ write_config_toml (
1837
+ "\
1838
+ [unstable.gitoxide]
1839
+ " ,
1840
+ ) ;
1841
+ let gctx = GlobalContextBuilder :: new ( ) . build ( ) ;
1842
+ verify ( gctx) ;
1843
+
1844
+ fn verify ( gctx : GlobalContext ) {
1845
+ assert_error (
1846
+ gctx. get :: < Option < cargo:: core:: CliUnstable > > ( "unstable" )
1847
+ . unwrap_err ( ) ,
1848
+ "missing field `fetch`" ,
1849
+ ) ;
1850
+ }
1851
+ }
You can’t perform that action at this time.
0 commit comments