@@ -1081,7 +1081,7 @@ func TestLibCommandsWithLibraryHavingInvalidVersion(t *testing.T) {
1081
1081
stdout , _ , err := cli .Run ("lib" , "list" , "--format" , "json" )
1082
1082
require .NoError (t , err )
1083
1083
requirejson .Len (t , stdout , 1 )
1084
- requirejson .Query (t , stdout , ".[0] | .library | .version" , " \" 0.16.1\" " )
1084
+ requirejson .Query (t , stdout , ".[0] | .library | .version" , `" 0.16.1"` )
1085
1085
1086
1086
// Changes the version of the currently installed library so that it's
1087
1087
// invalid
@@ -1119,9 +1119,7 @@ func TestInstallZipLibWithMacosMetadata(t *testing.T) {
1119
1119
// Verifies library is not already installed
1120
1120
require .NoDirExists (t , libInstallDir .String ())
1121
1121
1122
- wd , err := paths .Getwd ()
1123
- require .NoError (t , err )
1124
- zipPath := wd .Parent ().Join ("testdata" , "fake-lib.zip" )
1122
+ zipPath := paths .New (".." , "testdata" , "fake-lib.zip" )
1125
1123
// Test zip-path install
1126
1124
stdout , _ , err := cli .Run ("lib" , "install" , "--zip-path" , zipPath .String ())
1127
1125
require .NoError (t , err )
@@ -1156,9 +1154,7 @@ func TestInstallZipInvalidLibrary(t *testing.T) {
1156
1154
// Verifies library is not already installed
1157
1155
require .NoDirExists (t , libInstallDir .String ())
1158
1156
1159
- wd , err := paths .Getwd ()
1160
- require .NoError (t , err )
1161
- zipPath := wd .Parent ().Join ("testdata" , "lib-without-header.zip" )
1157
+ zipPath := paths .New (".." , "testdata" , "lib-without-header.zip" )
1162
1158
// Test zip-path install
1163
1159
_ , stderr , err := cli .Run ("lib" , "install" , "--zip-path" , zipPath .String ())
1164
1160
require .Error (t , err )
@@ -1168,7 +1164,7 @@ func TestInstallZipInvalidLibrary(t *testing.T) {
1168
1164
// Verifies library is not already installed
1169
1165
require .NoDirExists (t , libInstallDir .String ())
1170
1166
1171
- zipPath = wd . Parent (). Join ( "testdata" , "lib-without-properties.zip" )
1167
+ zipPath = paths . New ( ".." , "testdata" , "lib-without-properties.zip" )
1172
1168
// Test zip-path install
1173
1169
_ , stderr , err = cli .Run ("lib" , "install" , "--zip-path" , zipPath .String ())
1174
1170
require .Error (t , err )
@@ -1192,7 +1188,7 @@ func TestInstallGitInvalidLibrary(t *testing.T) {
1192
1188
libProperties := repoDir .Join ("library.properties" )
1193
1189
f , err := libProperties .Create ()
1194
1190
require .NoError (t , err )
1195
- f .Close ()
1191
+ require . NoError ( t , f .Close () )
1196
1192
tree , err := repo .Worktree ()
1197
1193
require .NoError (t , err )
1198
1194
_ , err = tree .Add ("library.properties" )
@@ -1218,7 +1214,7 @@ func TestInstallGitInvalidLibrary(t *testing.T) {
1218
1214
require .NoError (t , libHeader .Parent ().MkdirAll ())
1219
1215
f , err = libHeader .Create ()
1220
1216
require .NoError (t , err )
1221
- f .Close ()
1217
+ require . NoError ( t , f .Close () )
1222
1218
tree , err = repo .Worktree ()
1223
1219
require .NoError (t , err )
1224
1220
_ , err = tree .Add ("src/lib-without-properties.h" )
@@ -1246,11 +1242,9 @@ func TestUpgradeDoesNotTryToUpgradeBundledCoreLibrariesInSketchbook(t *testing.T
1246
1242
require .NoError (t , platformInstallDir .Parent ().MkdirAll ())
1247
1243
1248
1244
// Install platform in Sketchbook hardware dir
1249
- wd , err := paths .Getwd ()
1250
- require .NoError (t , err )
1251
- require .NoError (t , wd .Parent ().Join ("testdata" , testPlatformName ).CopyDirTo (platformInstallDir ))
1245
+ require .NoError (t , paths .New (".." , "testdata" , testPlatformName ).CopyDirTo (platformInstallDir ))
1252
1246
1253
- _ , _ , err = cli .Run ("update" )
1247
+ _ , _ , err : = cli .Run ("update" )
1254
1248
require .NoError (t , err )
1255
1249
1256
1250
// Install latest version of library identical to one
@@ -1262,8 +1256,8 @@ func TestUpgradeDoesNotTryToUpgradeBundledCoreLibrariesInSketchbook(t *testing.T
1262
1256
require .NoError (t , err )
1263
1257
requirejson .Len (t , stdout , 2 )
1264
1258
// Verify both libraries have the same name
1265
- requirejson .Query (t , stdout , ".[0] | .library | .name" , " \" USBHost\" " )
1266
- requirejson .Query (t , stdout , ".[1] | .library | .name" , " \" USBHost\" " )
1259
+ requirejson .Query (t , stdout , ".[0] | .library | .name" , `" USBHost"` )
1260
+ requirejson .Query (t , stdout , ".[1] | .library | .name" , `" USBHost"` )
1267
1261
1268
1262
stdout , _ , err = cli .Run ("lib" , "upgrade" )
1269
1263
require .NoError (t , err )
@@ -1280,11 +1274,9 @@ func TestUpgradeDoesNotTryToUpgradeBundledCoreLibraries(t *testing.T) {
1280
1274
require .NoError (t , platformInstallDir .Parent ().MkdirAll ())
1281
1275
1282
1276
// Install platform in Sketchbook hardware dir
1283
- wd , err := paths .Getwd ()
1284
- require .NoError (t , err )
1285
- require .NoError (t , wd .Parent ().Join ("testdata" , testPlatformName ).CopyDirTo (platformInstallDir ))
1277
+ require .NoError (t , paths .New (".." , "testdata" , testPlatformName ).CopyDirTo (platformInstallDir ))
1286
1278
1287
- _ , _ , err = cli .Run ("update" )
1279
+ _ , _ , err : = cli .Run ("update" )
1288
1280
require .NoError (t , err )
1289
1281
1290
1282
// Install latest version of library identical to one
@@ -1296,8 +1288,8 @@ func TestUpgradeDoesNotTryToUpgradeBundledCoreLibraries(t *testing.T) {
1296
1288
require .NoError (t , err )
1297
1289
requirejson .Len (t , stdout , 2 )
1298
1290
// Verify both libraries have the same name
1299
- requirejson .Query (t , stdout , ".[0] | .library | .name" , " \" USBHost\" " )
1300
- requirejson .Query (t , stdout , ".[1] | .library | .name" , " \" USBHost\" " )
1291
+ requirejson .Query (t , stdout , ".[0] | .library | .name" , `" USBHost"` )
1292
+ requirejson .Query (t , stdout , ".[1] | .library | .name" , `" USBHost"` )
1301
1293
1302
1294
stdout , _ , err = cli .Run ("lib" , "upgrade" )
1303
1295
require .NoError (t , err )
@@ -1472,7 +1464,7 @@ func TestInstallWithGitUrlLocalFileUri(t *testing.T) {
1472
1464
})
1473
1465
require .NoError (t , err )
1474
1466
1475
- _ , _ , err = cli .RunWithCustomEnv (envVar , "lib" , "install" , "--git-url" , "file:/// " + repoDir .String ())
1467
+ _ , _ , err = cli .RunWithCustomEnv (envVar , "lib" , "install" , "--git-url" , "file://" + repoDir .String ())
1476
1468
require .NoError (t , err )
1477
1469
1478
1470
// Verifies library is installed
0 commit comments