@@ -97,7 +97,10 @@ func TestLibInstallMultipleSameLibrary(t *testing.T) {
9797 require .NoError (t , err )
9898 jsonOut , _ , err := cli .Run ("lib" , "list" , "--format" , "json" )
9999 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'" )
101104
102105 // Check that 'lib upgrade' didn't create a double install
103106 // https://github.com/arduino/arduino-cli/issues/1870
@@ -109,7 +112,10 @@ func TestLibInstallMultipleSameLibrary(t *testing.T) {
109112 require .NoError (t , err )
110113 jsonOut , _ , err = cli .Run ("lib" , "list" , "--format" , "json" )
111114 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'" )
113119}
114120
115121func TestDuplicateLibInstallDetection (t * testing.T ) {
0 commit comments