@@ -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,8 @@ 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 ()
1122
+ zipPath , err := paths .New ( ".." , "testdata" , "fake-lib.zip" ). Abs ()
1123
1123
require .NoError (t , err )
1124
- zipPath := wd .Parent ().Join ("testdata" , "fake-lib.zip" )
1125
1124
// Test zip-path install
1126
1125
stdout , _ , err := cli .Run ("lib" , "install" , "--zip-path" , zipPath .String ())
1127
1126
require .NoError (t , err )
@@ -1156,9 +1155,8 @@ func TestInstallZipInvalidLibrary(t *testing.T) {
1156
1155
// Verifies library is not already installed
1157
1156
require .NoDirExists (t , libInstallDir .String ())
1158
1157
1159
- wd , err := paths .Getwd ()
1158
+ zipPath , err := paths .New ( ".." , "testdata" , "lib-without-header.zip" ). Abs ()
1160
1159
require .NoError (t , err )
1161
- zipPath := wd .Parent ().Join ("testdata" , "lib-without-header.zip" )
1162
1160
// Test zip-path install
1163
1161
_ , stderr , err := cli .Run ("lib" , "install" , "--zip-path" , zipPath .String ())
1164
1162
require .Error (t , err )
@@ -1168,7 +1166,8 @@ func TestInstallZipInvalidLibrary(t *testing.T) {
1168
1166
// Verifies library is not already installed
1169
1167
require .NoDirExists (t , libInstallDir .String ())
1170
1168
1171
- zipPath = wd .Parent ().Join ("testdata" , "lib-without-properties.zip" )
1169
+ zipPath , err = paths .New (".." , "testdata" , "lib-without-properties.zip" ).Abs ()
1170
+ require .NoError (t , err )
1172
1171
// Test zip-path install
1173
1172
_ , stderr , err = cli .Run ("lib" , "install" , "--zip-path" , zipPath .String ())
1174
1173
require .Error (t , err )
@@ -1192,7 +1191,7 @@ func TestInstallGitInvalidLibrary(t *testing.T) {
1192
1191
libProperties := repoDir .Join ("library.properties" )
1193
1192
f , err := libProperties .Create ()
1194
1193
require .NoError (t , err )
1195
- f .Close ()
1194
+ require . NoError ( t , f .Close () )
1196
1195
tree , err := repo .Worktree ()
1197
1196
require .NoError (t , err )
1198
1197
_ , err = tree .Add ("library.properties" )
@@ -1218,7 +1217,7 @@ func TestInstallGitInvalidLibrary(t *testing.T) {
1218
1217
require .NoError (t , libHeader .Parent ().MkdirAll ())
1219
1218
f , err = libHeader .Create ()
1220
1219
require .NoError (t , err )
1221
- f .Close ()
1220
+ require . NoError ( t , f .Close () )
1222
1221
tree , err = repo .Worktree ()
1223
1222
require .NoError (t , err )
1224
1223
_ , err = tree .Add ("src/lib-without-properties.h" )
@@ -1246,11 +1245,9 @@ func TestUpgradeDoesNotTryToUpgradeBundledCoreLibrariesInSketchbook(t *testing.T
1246
1245
require .NoError (t , platformInstallDir .Parent ().MkdirAll ())
1247
1246
1248
1247
// 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 ))
1248
+ require .NoError (t , paths .New (".." , "testdata" , testPlatformName ).CopyDirTo (platformInstallDir ))
1252
1249
1253
- _ , _ , err = cli .Run ("update" )
1250
+ _ , _ , err : = cli .Run ("update" )
1254
1251
require .NoError (t , err )
1255
1252
1256
1253
// Install latest version of library identical to one
@@ -1262,8 +1259,8 @@ func TestUpgradeDoesNotTryToUpgradeBundledCoreLibrariesInSketchbook(t *testing.T
1262
1259
require .NoError (t , err )
1263
1260
requirejson .Len (t , stdout , 2 )
1264
1261
// 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\" " )
1262
+ requirejson .Query (t , stdout , ".[0] | .library | .name" , `" USBHost"` )
1263
+ requirejson .Query (t , stdout , ".[1] | .library | .name" , `" USBHost"` )
1267
1264
1268
1265
stdout , _ , err = cli .Run ("lib" , "upgrade" )
1269
1266
require .NoError (t , err )
@@ -1280,11 +1277,9 @@ func TestUpgradeDoesNotTryToUpgradeBundledCoreLibraries(t *testing.T) {
1280
1277
require .NoError (t , platformInstallDir .Parent ().MkdirAll ())
1281
1278
1282
1279
// 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 ))
1280
+ require .NoError (t , paths .New (".." , "testdata" , testPlatformName ).CopyDirTo (platformInstallDir ))
1286
1281
1287
- _ , _ , err = cli .Run ("update" )
1282
+ _ , _ , err : = cli .Run ("update" )
1288
1283
require .NoError (t , err )
1289
1284
1290
1285
// Install latest version of library identical to one
@@ -1296,8 +1291,8 @@ func TestUpgradeDoesNotTryToUpgradeBundledCoreLibraries(t *testing.T) {
1296
1291
require .NoError (t , err )
1297
1292
requirejson .Len (t , stdout , 2 )
1298
1293
// 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\" " )
1294
+ requirejson .Query (t , stdout , ".[0] | .library | .name" , `" USBHost"` )
1295
+ requirejson .Query (t , stdout , ".[1] | .library | .name" , `" USBHost"` )
1301
1296
1302
1297
stdout , _ , err = cli .Run ("lib" , "upgrade" )
1303
1298
require .NoError (t , err )
@@ -1472,7 +1467,7 @@ func TestInstallWithGitUrlLocalFileUri(t *testing.T) {
1472
1467
})
1473
1468
require .NoError (t , err )
1474
1469
1475
- _ , _ , err = cli .RunWithCustomEnv (envVar , "lib" , "install" , "--git-url" , "file:/// " + repoDir .String ())
1470
+ _ , _ , err = cli .RunWithCustomEnv (envVar , "lib" , "install" , "--git-url" , "file://" + repoDir .String ())
1476
1471
require .NoError (t , err )
1477
1472
1478
1473
// Verifies library is installed
0 commit comments