@@ -1009,6 +1009,7 @@ foo v0.1.0 ([..]/foo)
1009
1009
#[ cargo_test]
1010
1010
fn format ( ) {
1011
1011
Package :: new ( "dep" , "1.0.0" ) . publish ( ) ;
1012
+
1012
1013
Package :: new ( "dep_that_is_awesome" , "1.0.0" )
1013
1014
. file (
1014
1015
"Cargo.toml" ,
@@ -1036,7 +1037,7 @@ fn format() {
1036
1037
1037
1038
[dependencies]
1038
1039
dep = {version="1.0", optional=true}
1039
- dep_that_is_awesome = {version="1.0"}
1040
+ dep_that_is_awesome = {version="1.0", optional=true }
1040
1041
1041
1042
[features]
1042
1043
default = ["foo"]
@@ -1048,9 +1049,7 @@ fn format() {
1048
1049
. build ( ) ;
1049
1050
1050
1051
p. cargo ( "tree --format <<<{p}>>>" )
1051
- . with_stdout ( "\
1052
- <<<foo v0.1.0 ([..]/foo)>>>
1053
- └── <<<dep_that_is_awesome v1.0.0>>>" )
1052
+ . with_stdout ( "<<<foo v0.1.0 ([..]/foo)>>>" )
1054
1053
. run ( ) ;
1055
1054
1056
1055
p. cargo ( "tree --format {}" )
@@ -1066,42 +1065,40 @@ Caused by:
1066
1065
. run ( ) ;
1067
1066
1068
1067
p. cargo ( "tree --format {p}-{{hello}}" )
1069
- . with_stdout ( "\
1070
- foo v0.1.0 ([..]/foo)-{hello}
1071
- └── dep_that_is_awesome v1.0.0-{hello}" )
1068
+ . with_stdout ( "foo v0.1.0 ([..]/foo)-{hello}" )
1072
1069
. run ( ) ;
1073
1070
1074
1071
p. cargo ( "tree --format" )
1075
1072
. arg ( "{p} {l} {r}" )
1076
- . with_stdout ( "\
1077
- foo v0.1.0 ([..]/foo) MIT https://github.com/rust-lang/cargo
1078
- └── dep_that_is_awesome v1.0.0 " )
1073
+ . with_stdout ( "foo v0.1.0 ([..]/foo) MIT https://github.com/rust-lang/cargo" )
1079
1074
. run ( ) ;
1080
1075
1081
1076
p. cargo ( "tree --format" )
1082
1077
. arg ( "{p} {f}" )
1083
- . with_stdout ( "\
1084
- foo v0.1.0 ([..]/foo) bar,default,foo
1085
- └── dep_that_is_awesome v1.0.0 " )
1078
+ . with_stdout ( "foo v0.1.0 ([..]/foo) bar,default,foo" )
1086
1079
. run ( ) ;
1087
1080
1088
1081
p. cargo ( "tree --all-features --format" )
1089
1082
. arg ( "{p} [{f}]" )
1090
1083
. with_stdout (
1091
1084
"\
1092
- foo v0.1.0 ([..]/foo) [bar,default,dep,foo]
1085
+ foo v0.1.0 ([..]/foo) [bar,default,dep,dep_that_is_awesome, foo]
1093
1086
├── dep v1.0.0 []
1094
1087
└── dep_that_is_awesome v1.0.0 []
1095
1088
" ,
1096
1089
)
1097
1090
. run ( ) ;
1098
1091
1099
- p. cargo ( "tree --format {n}" )
1100
- . with_stdout ( "\
1092
+ p. cargo ( "tree" )
1093
+ . arg ( "--features=dep_that_is_awesome" )
1094
+ . arg ( "--format={lib}" )
1095
+ . with_stdout (
1096
+ "\
1101
1097
foo
1102
- └── awesome_dep" )
1098
+ └── awesome_dep
1099
+ " ,
1100
+ )
1103
1101
. run ( ) ;
1104
-
1105
1102
}
1106
1103
1107
1104
#[ cargo_test]
0 commit comments