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 @@ -1923,3 +1923,51 @@ Caused by:
1923
1923
missing field `bax`" ,
1924
1924
) ;
1925
1925
}
1926
+
1927
+ #[ cargo_test]
1928
+ fn git_features_env ( ) {
1929
+ let gctx = GlobalContextBuilder :: new ( )
1930
+ . env ( "CARGO_UNSTABLE_GIT" , "true" )
1931
+ . build ( ) ;
1932
+ verify ( gctx) ;
1933
+
1934
+ write_config_toml (
1935
+ "\
1936
+ [unstable.git]
1937
+ " ,
1938
+ ) ;
1939
+ let gctx = GlobalContextBuilder :: new ( ) . build ( ) ;
1940
+ verify ( gctx) ;
1941
+
1942
+ fn verify ( gctx : GlobalContext ) {
1943
+ assert_error (
1944
+ gctx. get :: < Option < cargo:: core:: CliUnstable > > ( "unstable" )
1945
+ . unwrap_err ( ) ,
1946
+ "missing field `shallow_index`" ,
1947
+ ) ;
1948
+ }
1949
+ }
1950
+
1951
+ #[ cargo_test]
1952
+ fn gitoxide_features_env ( ) {
1953
+ let gctx = GlobalContextBuilder :: new ( )
1954
+ . env ( "CARGO_UNSTABLE_GITOXIDE" , "true" )
1955
+ . build ( ) ;
1956
+ verify ( gctx) ;
1957
+
1958
+ write_config_toml (
1959
+ "\
1960
+ [unstable.gitoxide]
1961
+ " ,
1962
+ ) ;
1963
+ let gctx = GlobalContextBuilder :: new ( ) . build ( ) ;
1964
+ verify ( gctx) ;
1965
+
1966
+ fn verify ( gctx : GlobalContext ) {
1967
+ assert_error (
1968
+ gctx. get :: < Option < cargo:: core:: CliUnstable > > ( "unstable" )
1969
+ . unwrap_err ( ) ,
1970
+ "missing field `fetch`" ,
1971
+ ) ;
1972
+ }
1973
+ }
You can’t perform that action at this time.
0 commit comments