@@ -97,7 +97,10 @@ func TestLibInstallMultipleSameLibrary(t *testing.T) {
97
97
require .NoError (t , err )
98
98
jsonOut , _ , err := cli .Run ("lib" , "list" , "--format" , "json" )
99
99
require .NoError (t , err )
100
- requirejson .Len (t , jsonOut , 1 , "A duplicate library install has been detected" )
100
+ // Count how many libraries with the name "Arduino SigFox for MKRFox1200" are installed
101
+ requirejson .Parse (t , jsonOut ).
102
+ Query (`[.[].library.name | select(. == "Arduino SigFox for MKRFox1200")]` ).
103
+ LengthMustEqualTo (1 , "Found multiple installations of Arduino SigFox for MKRFox1200'" )
101
104
102
105
// Check that 'lib upgrade' didn't create a double install
103
106
// https://github.com/arduino/arduino-cli/issues/1870
@@ -109,7 +112,10 @@ func TestLibInstallMultipleSameLibrary(t *testing.T) {
109
112
require .NoError (t , err )
110
113
jsonOut , _ , err = cli .Run ("lib" , "list" , "--format" , "json" )
111
114
require .NoError (t , err )
112
- requirejson .Len (t , jsonOut , 1 , "A duplicate library install has been detected" )
115
+ // Count how many libraries with the name "Arduino SigFox for MKRFox1200" are installed
116
+ requirejson .Parse (t , jsonOut ).
117
+ Query (`[.[].library.name | select(. == "Arduino SigFox for MKRFox1200")]` ).
118
+ LengthMustEqualTo (1 , "Found multiple installations of Arduino SigFox for MKRFox1200'" )
113
119
}
114
120
115
121
func TestDuplicateLibInstallDetection (t * testing.T ) {
0 commit comments