@@ -1134,15 +1134,15 @@ func TestCoreHavingIncompatibleDepTools(t *testing.T) {
11341134 stdout , _ , err := cli .Run ("core" , "list" , "--all" , "--format" , "json" , additionalURLs )
11351135 require .NoError (t , err )
11361136 t .Log (string (stdout ))
1137- requirejson .Query (t , stdout , `.[] | select(.id == "foo_vendor:avr") | .latest ` , `"1.0.2"` )
1138- requirejson .Query (t , stdout , `.[] | select(.id == "foo_vendor:avr") | .latest_compatible ` , `"1.0.1"` )
1137+ requirejson .Query (t , stdout , `.[] | select(.id == "foo_vendor:avr") | .latest_version ` , `"1.0.2"` )
1138+ requirejson .Query (t , stdout , `.[] | select(.id == "foo_vendor:avr") | .latest_compatible_version ` , `"1.0.1"` )
11391139
11401140 // install latest compatible version
11411141 _ , _ , err = cli .Run ("core" , "install" , "foo_vendor:avr" , additionalURLs )
11421142 require .NoError (t , err )
11431143 stdout , _ , err = cli .Run ("core" , "list" , "--all" , "--format" , "json" , additionalURLs )
11441144 require .NoError (t , err )
1145- requirejson .Query (t , stdout , `.[] | select(.id == "foo_vendor:avr") | .latest_compatible ` , `"1.0.1"` )
1145+ requirejson .Query (t , stdout , `.[] | select(.id == "foo_vendor:avr") | .latest_compatible_version ` , `"1.0.1"` )
11461146
11471147 // install incompatible version
11481148 _ ,
stderr ,
err := cli .
Run (
"core" ,
"install" ,
"foo_vendor:[email protected] " ,
additionalURLs )
@@ -1154,26 +1154,26 @@ func TestCoreHavingIncompatibleDepTools(t *testing.T) {
11541154 require .NoError (t , err )
11551155 stdout , _ , err = cli .Run ("core" , "list" , "--format" , "json" , additionalURLs )
11561156 require .NoError (t , err )
1157- requirejson .Query (t , stdout , `.[] | select(.id == "foo_vendor:avr") | .installed ` , `"1.0.0"` )
1157+ requirejson .Query (t , stdout , `.[] | select(.id == "foo_vendor:avr") | .installed_version ` , `"1.0.0"` )
11581158
11591159 // Lists all updatable cores
11601160 stdout , _ , err = cli .Run ("core" , "list" , "--updatable" , "--format" , "json" , additionalURLs )
11611161 require .NoError (t , err )
1162- requirejson .Query (t , stdout , `.[] | select(.id == "foo_vendor:avr") | .latest_compatible ` , `"1.0.1"` )
1162+ requirejson .Query (t , stdout , `.[] | select(.id == "foo_vendor:avr") | .latest_compatible_version ` , `"1.0.1"` )
11631163
11641164 // upgrade to latest compatible (1.0.0 -> 1.0.1)
11651165 _ , _ , err = cli .Run ("core" , "upgrade" , "foo_vendor:avr" , "--format" , "json" , additionalURLs )
11661166 require .NoError (t , err )
11671167 stdout , _ , err = cli .Run ("core" , "list" , "--format" , "json" , additionalURLs )
11681168 require .NoError (t , err )
1169- requirejson .Query (t , stdout , `.[] | select(.id == "foo_vendor:avr") | .installed ` , `"1.0.1"` )
1169+ requirejson .Query (t , stdout , `.[] | select(.id == "foo_vendor:avr") | .installed_version ` , `"1.0.1"` )
11701170
11711171 // upgrade to latest incompatible not possible (1.0.1 -> 1.0.2)
11721172 _ , _ , err = cli .Run ("core" , "upgrade" , "foo_vendor:avr" , "--format" , "json" , additionalURLs )
11731173 require .NoError (t , err )
11741174 stdout , _ , err = cli .Run ("core" , "list" , "--format" , "json" , additionalURLs )
11751175 require .NoError (t , err )
1176- requirejson .Query (t , stdout , `.[] | select(.id == "foo_vendor:avr") | .installed ` , `"1.0.1"` )
1176+ requirejson .Query (t , stdout , `.[] | select(.id == "foo_vendor:avr") | .installed_version ` , `"1.0.1"` )
11771177
11781178 // When no compatible version are found return error
11791179 _ , stderr , err = cli .Run ("core" , "install" , "incompatible_vendor:avr" , additionalURLs )
@@ -1184,19 +1184,19 @@ func TestCoreHavingIncompatibleDepTools(t *testing.T) {
11841184 stdout , _ , err = cli .Run ("core" , "search" , "--all" , "--format" , "json" , additionalURLs )
11851185 require .NoError (t , err )
11861186 requirejson .Query (t , stdout ,
1187- `[.[] | select(.id == "foo_vendor:avr") | {latest : .latest , incompatible: .incompatible}] | sort_by(.latest )` ,
1187+ `[.[] | select(.id == "foo_vendor:avr") | .releases | map(.) | .[] | {version : .version , incompatible: .incompatible}] | sort_by(.version )` ,
11881188 `[
1189- {"incompatible":null,"latest ":"1.0.0"},
1190- {"incompatible":null,"latest ":"1.0.1"},
1191- {"incompatible":true,"latest ":"1.0.2"}
1189+ {"incompatible":null,"version ":"1.0.0"},
1190+ {"incompatible":null,"version ":"1.0.1"},
1191+ {"incompatible":true,"version ":"1.0.2"}
11921192 ]` ,
11931193 )
11941194
1195- // Core search shows latest compatible version
1195+ // Core search shows latest compatible version even if incompatible
11961196 stdout , _ , err = cli .Run ("core" , "search" , "--format" , "json" , additionalURLs )
11971197 require .NoError (t , err )
1198- requirejson .Query (t , stdout , `.[] | select(.id == "foo_vendor:avr") | .latest ` , `"1.0.1 "` )
1199- requirejson .Query (t , stdout , `.[] | select(.id == "incompatible_vendor:avr") | .incompatible` , `true` )
1198+ requirejson .Query (t , stdout , `.[] | select(.id == "foo_vendor:avr") | .latest_version ` , `"1.0.2 "` )
1199+ requirejson .Query (t , stdout , `.[] | select(.id == "incompatible_vendor:avr") | .releases[.latest_version]. incompatible` , `true` )
12001200
12011201 // In text mode, core search doesn't show any version if no compatible one are present
12021202 stdout , _ , err = cli .Run ("core" , "search" , additionalURLs )
@@ -1205,5 +1205,5 @@ func TestCoreHavingIncompatibleDepTools(t *testing.T) {
12051205 for _ , v := range strings .Split (strings .TrimSpace (string (stdout )), "\n " ) {
12061206 lines = append (lines , strings .Fields (strings .TrimSpace (v )))
12071207 }
1208- require .Contains (t , lines , []string {"incompatible_vendor:avr" , "Incompatible" , "Boards" })
1208+ require .Contains (t , lines , []string {"incompatible_vendor:avr" })
12091209}
0 commit comments