forked from arduino/arduino-cli
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcommands_test.go
578 lines (485 loc) · 19.5 KB
/
commands_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
/*
* This file is part of arduino-cli.
*
* Copyright 2018 ARDUINO SA (http://www.arduino.cc/)
*
* This software is released under the GNU General Public License version 3,
* which covers the main part of arduino-cli.
* The terms of this license can be found at:
* https://www.gnu.org/licenses/gpl-3.0.en.html
*
* You can be released from the requirements of the above licenses by purchasing
* a commercial license. Buying such a license is mandatory if you want to modify or
* otherwise use the software for commercial activities involving the Arduino
* software without disclosing the source code of your own applications. To purchase
* a commercial license, send an email to [email protected].
*/
package commands_test
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
"strings"
"testing"
"github.com/arduino/arduino-cli/commands/root"
"github.com/arduino/go-paths-helper"
"github.com/bouk/monkey"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.bug.st/relaxed-semver"
)
// Redirecting stdOut so we can analyze output line by
// line and check with what we want.
var stdOut = os.Stdout
type stdOutRedirect struct {
tempFile *os.File
t *testing.T
}
func (grabber *stdOutRedirect) Open(t *testing.T) {
tempFile, err := ioutil.TempFile(os.TempDir(), "test")
require.NoError(t, err, "Opening temp output file")
os.Stdout = tempFile
grabber.tempFile = tempFile
grabber.t = t
}
func (grabber *stdOutRedirect) GetOutput() []byte {
_, err := grabber.tempFile.Seek(0, 0)
require.NoError(grabber.t, err, "Rewinding temp output file")
output, err := ioutil.ReadAll(grabber.tempFile)
require.NoError(grabber.t, err, "Reading temp output file")
return output
}
func (grabber *stdOutRedirect) Close() {
grabber.tempFile.Close()
err := os.Remove(grabber.tempFile.Name())
assert.NoError(grabber.t, err, "Removing temp output file")
os.Stdout = stdOut
}
// executeWithArgs executes the Cobra Command with the given arguments
// and intercepts any errors (even `os.Exit()` ones), returning the exit code
func executeWithArgs(t *testing.T, args ...string) (int, []byte) {
var output []byte
var exitCode int
fmt.Printf("RUNNING: %s\n", args)
// This closure is here because we won't that the defer are executed after the end of the "executeWithArgs" method
func() {
redirect := &stdOutRedirect{}
redirect.Open(t)
defer func() {
output = redirect.GetOutput()
redirect.Close()
fmt.Print(string(output))
fmt.Println()
}()
// Mock the os.Exit function, so that we can use the
// error result for the test and prevent the test from exiting
fakeExitFired := false
fakeExit := func(code int) {
exitCode = code
fakeExitFired = true
// use panic to exit and jump to deferred recover
panic(fmt.Errorf("os.Exit(%d)", code))
}
patch := monkey.Patch(os.Exit, fakeExit)
defer patch.Unpatch()
defer func() {
if fakeExitFired {
recover()
}
}()
// Execute the CLI command, in this process
cmd := root.Init()
cmd.SetArgs(args)
cmd.Execute()
}()
return exitCode, output
}
var currDataDir *paths.Path
func makeTempDataDir(t *testing.T) func() {
tmp, err := paths.MkTempDir("", "test")
require.NoError(t, err, "making temporary staging dir")
os.Setenv("ARDUINO_DATA_DIR", tmp.String())
currDataDir = tmp
fmt.Printf("ARDUINO_DATA_DIR = %s\n", os.Getenv("ARDUINO_DATA_DIR"))
err = tmp.RemoveAll() // To test if the data dir is automatically created
require.NoError(t, err)
return func() {
os.Unsetenv("ARDUINO_DATA_DIR")
currDataDir = nil
tmp.RemoveAll()
fmt.Printf("ARDUINO_DATA_DIR = %s\n", os.Getenv("ARDUINO_DATA_DIR"))
}
}
var currSketchbookDir *paths.Path
func makeTempSketchbookDir(t *testing.T) func() {
tmp, err := paths.MkTempDir("", "test")
require.NoError(t, err, "making temporary staging dir")
os.Setenv("ARDUINO_SKETCHBOOK_DIR", tmp.String())
currSketchbookDir = tmp
err = tmp.RemoveAll() // To test if the sketchbook dir is automatically created
require.NoError(t, err)
fmt.Printf("ARDUINO_SKETCHBOOK_DIR = %s\n", os.Getenv("ARDUINO_SKETCHBOOK_DIR"))
return func() {
os.Unsetenv("ARDUINO_SKETCHBOOK_DIR")
currSketchbookDir = nil
tmp.RemoveAll()
fmt.Printf("ARDUINO_SKETCHBOOK_DIR = %s\n", os.Getenv("ARDUINO_SKETCHBOOK_DIR"))
}
}
// END -- Utility functions
func TestLibSearch(t *testing.T) {
defer makeTempDataDir(t)()
defer makeTempSketchbookDir(t)()
exitCode, output := executeWithArgs(t, "lib", "search", "audiozer", "--format", "json")
require.Zero(t, exitCode, "process exit code")
var res struct {
Libraries []struct {
Name string
}
}
err := json.Unmarshal(output, &res)
require.NoError(t, err, "decoding json output")
require.NotNil(t, res.Libraries)
require.Len(t, res.Libraries, 1)
require.Equal(t, res.Libraries[0].Name, "AudioZero")
exitCode, output = executeWithArgs(t, "lib", "search", "audiozero", "--names")
require.Zero(t, exitCode, "process exit code")
require.Equal(t, "AudioZero\n", string(output))
exitCode, output = executeWithArgs(t, "lib", "search", "audiozer", "--names")
require.Zero(t, exitCode, "process exit code")
require.Equal(t, "AudioZero\n", string(output))
exitCode, output = executeWithArgs(t, "lib", "search", "audiozerooooo", "--names")
require.Zero(t, exitCode, "process exit code")
require.Equal(t, "", string(output))
}
func TestUserLibs(t *testing.T) {
defer makeTempDataDir(t)()
defer makeTempSketchbookDir(t)()
libDir := currSketchbookDir.Join("libraries")
err := libDir.MkdirAll()
require.NoError(t, err, "creating 'sketchbook/libraries' dir")
installLib := func(lib string) {
libPath := paths.New("testdata/" + lib)
fmt.Printf("COPYING: %s in %s\n", libPath, libDir)
err = libPath.CopyDirTo(libDir.Join(lib))
require.NoError(t, err, "copying "+lib+" in sketchbook")
}
// List libraries (valid libs)
installLib("MyLib")
exitCode, d := executeWithArgs(t, "lib", "list")
require.Zero(t, exitCode, "exit code")
require.Contains(t, string(d), "MyLib")
require.Contains(t, string(d), "1.0.5")
// List libraries (pre-1.5 format)
installLib("MyLibPre15")
exitCode, d = executeWithArgs(t, "lib", "list")
require.Zero(t, exitCode, "exit code")
require.Contains(t, string(d), "MyLibPre15")
// List libraries (invalid version lib)
installLib("MyLibWithWrongVersion")
exitCode, d = executeWithArgs(t, "lib", "list")
require.Zero(t, exitCode, "exit code")
require.Contains(t, string(d), "MyLibWithWrongVersion")
}
func TestSketchCommands(t *testing.T) {
defer makeTempDataDir(t)()
defer makeTempSketchbookDir(t)()
//var d []byte
var exitCode int
exitCode, _ = executeWithArgs(t, "sketch", "new", "Test")
require.Zero(t, exitCode, "exit code")
}
func TestLibDownloadAndInstall(t *testing.T) {
defer makeTempDataDir(t)()
defer makeTempSketchbookDir(t)()
var d []byte
var exitCode int
exitCode, _ = executeWithArgs(t, "core", "update-index")
require.Zero(t, exitCode, "exit code")
// Download inexistent
exitCode, d = executeWithArgs(t, "lib", "download", "inexistentLibrary", "--format", "json")
require.NotZero(t, exitCode, "exit code")
require.Contains(t, string(d), "library inexistentLibrary not found")
exitCode, d = executeWithArgs(t, "lib", "download", "inexistentLibrary")
require.NotZero(t, exitCode, "exit code")
require.Contains(t, string(d), "library inexistentLibrary not found")
// Download latest
exitCode, d = executeWithArgs(t, "lib", "download", "Audio")
require.Zero(t, exitCode, "exit code")
require.Contains(t, string(d), "Audio@")
require.Contains(t, string(d), "downloaded")
// Download non existent version
exitCode, d = executeWithArgs(t, "lib", "download", "[email protected]")
require.NotZero(t, exitCode, "exit code")
require.Contains(t, string(d), "not found")
// Install latest
exitCode, d = executeWithArgs(t, "lib", "install", "Audio")
require.Zero(t, exitCode, "exit code")
require.Contains(t, string(d), "Audio@")
require.Contains(t, string(d), "Installed")
exitCode, d = executeWithArgs(t, "lib", "list")
require.Zero(t, exitCode, "exit code")
require.Contains(t, string(d), "Audio")
// Already installed
exitCode, d = executeWithArgs(t, "lib", "install", "Audio")
require.NotZero(t, exitCode, "exit code")
require.Contains(t, string(d), "Audio@")
require.Contains(t, string(d), "already installed")
// Install another version
exitCode, d = executeWithArgs(t, "lib", "install", "[email protected]")
require.Zero(t, exitCode, "exit code")
require.Contains(t, string(d), "[email protected]")
require.Contains(t, string(d), "Installed")
exitCode, d = executeWithArgs(t, "lib", "list")
require.Zero(t, exitCode, "exit code")
require.Contains(t, string(d), "Audio")
require.Contains(t, string(d), "1.0.4")
// List updatable
exitCode, d = executeWithArgs(t, "lib", "list", "--updatable")
require.Zero(t, exitCode, "exit code")
require.Contains(t, string(d), "Audio")
require.Contains(t, string(d), "1.0.4")
require.Contains(t, string(d), "1.0.5")
// Uninstall version not installed
exitCode, d = executeWithArgs(t, "lib", "uninstall", "[email protected]")
require.NotZero(t, exitCode, "exit code")
require.Contains(t, string(d), "[email protected]")
require.Contains(t, string(d), "not installed")
// Upgrade libraries
exitCode, d = executeWithArgs(t, "lib", "upgrade")
require.Zero(t, exitCode, "exit code")
require.Contains(t, string(d), "Installed")
require.Contains(t, string(d), "Audio")
require.Contains(t, string(d), "1.0.5")
// Uninstall (without version)
exitCode, d = executeWithArgs(t, "lib", "uninstall", "Audio")
require.Zero(t, exitCode, "exit code")
require.Contains(t, string(d), "Uninstalling")
require.Contains(t, string(d), "Audio")
require.Contains(t, string(d), "1.0.5")
exitCode, d = executeWithArgs(t, "lib", "list")
require.Zero(t, exitCode, "exit code")
require.NotContains(t, string(d), "Audio")
// Uninstall (with version)
exitCode, d = executeWithArgs(t, "lib", "install", "[email protected]")
require.Zero(t, exitCode, "exit code")
require.Contains(t, string(d), "[email protected]")
require.Contains(t, string(d), "Installed")
exitCode, d = executeWithArgs(t, "lib", "list")
require.Zero(t, exitCode, "exit code")
require.Contains(t, string(d), "Audio")
require.Contains(t, string(d), "1.0.4")
exitCode, d = executeWithArgs(t, "lib", "uninstall", "[email protected]")
require.Zero(t, exitCode, "exit code")
require.Contains(t, string(d), "Uninstalling")
require.Contains(t, string(d), "Audio")
require.Contains(t, string(d), "1.0.4")
exitCode, d = executeWithArgs(t, "lib", "list")
require.Zero(t, exitCode, "exit code")
require.NotContains(t, string(d), "Audio")
}
func updateCoreIndex(t *testing.T) {
// run a "core update-index" to download the package_index.json
exitCode, _ := executeWithArgs(t, "core", "update-index")
require.Equal(t, 0, exitCode, "exit code")
}
func detectLatestAVRCore(t *testing.T) string {
jsonFile := currDataDir.Join("package_index.json")
type index struct {
Packages []struct {
Name string
Platforms []struct {
Architecture string
Version string
}
}
}
var jsonIndex index
jsonData, err := jsonFile.ReadFile()
require.NoError(t, err, "reading package_index.json")
err = json.Unmarshal(jsonData, &jsonIndex)
require.NoError(t, err, "parsing package_index.json")
latest := semver.MustParse("0.0.1")
for _, p := range jsonIndex.Packages {
if p.Name == "arduino" {
for _, pl := range p.Platforms {
ver, err := semver.Parse(pl.Version)
require.NoError(t, err, "version parsing")
if pl.Architecture == "avr" && ver.GreaterThan(latest) {
latest = ver
}
}
break
}
}
require.NotEmpty(t, latest, "latest avr core version")
fmt.Println("Latest AVR core version:", latest)
return latest.String()
}
func TestCompileCommands(t *testing.T) {
defer makeTempDataDir(t)()
defer makeTempSketchbookDir(t)()
// Set staging dir to a temporary dir
tmp, err := ioutil.TempDir(os.TempDir(), "test")
require.NoError(t, err, "making temporary staging dir")
defer os.RemoveAll(tmp)
updateCoreIndex(t)
// Download latest AVR
exitCode, _ := executeWithArgs(t, "core", "install", "arduino:avr")
require.Zero(t, exitCode, "exit code")
// Create a test sketch
exitCode, d := executeWithArgs(t, "sketch", "new", "Test1")
require.Zero(t, exitCode, "exit code")
require.Contains(t, string(d), "Sketch created")
// Build sketch for arduino:avr:uno
test1 := currSketchbookDir.Join("Test1").String()
exitCode, d = executeWithArgs(t, "compile", "-b", "arduino:avr:uno", test1)
require.Zero(t, exitCode, "exit code")
require.Contains(t, string(d), "Sketch uses")
require.True(t, paths.New(test1).Join("Test1.arduino.avr.uno.hex").Exist())
// Build sketch for arduino:avr:nano (without options)
exitCode, d = executeWithArgs(t, "compile", "-b", "arduino:avr:nano", test1)
require.Zero(t, exitCode, "exit code")
require.Contains(t, string(d), "Sketch uses")
require.True(t, paths.New(test1).Join("Test1.arduino.avr.nano.hex").Exist())
// Build sketch with --output path
require.NoError(t, os.Chdir(tmp))
exitCode, d = executeWithArgs(t, "compile", "-b", "arduino:avr:nano", "-o", "test", test1)
require.Zero(t, exitCode, "exit code")
require.Contains(t, string(d), "Sketch uses")
require.True(t, paths.New("test.hex").Exist())
exitCode, d = executeWithArgs(t, "compile", "-b", "arduino:avr:nano", "-o", "test2.hex", test1)
require.Zero(t, exitCode, "exit code")
require.Contains(t, string(d), "Sketch uses")
require.True(t, paths.New("test2.hex").Exist())
require.NoError(t, paths.New(tmp, "anothertest").MkdirAll())
exitCode, d = executeWithArgs(t, "compile", "-b", "arduino:avr:nano", "-o", "anothertest/test", test1)
require.Zero(t, exitCode, "exit code")
require.Contains(t, string(d), "Sketch uses")
require.True(t, paths.New("anothertest", "test.hex").Exist())
exitCode, d = executeWithArgs(t, "compile", "-b", "arduino:avr:nano", "-o", tmp+"/anothertest/test2", test1)
require.Zero(t, exitCode, "exit code")
require.Contains(t, string(d), "Sketch uses")
require.True(t, paths.New("anothertest", "test2.hex").Exist())
}
func TestInvalidCoreURL(t *testing.T) {
defer makeTempDataDir(t)()
defer makeTempSketchbookDir(t)()
tmp, err := paths.MkTempDir("", "")
require.NoError(t, err, "making temporary dir")
defer tmp.RemoveAll()
configFile := tmp.Join("cli-config.yml")
configFile.WriteFile([]byte(`
board_manager:
additional_urls:
- http://www.example.com/package_example_index.json
`))
require.NoError(t, currDataDir.MkdirAll())
err = currDataDir.Join("package_index.json").WriteFile([]byte(`{ "packages": [] }`))
require.NoError(t, err, "Writing empty json index file")
err = currDataDir.Join("package_example_index.json").WriteFile([]byte(`{ "packages": [] }`))
require.NoError(t, err, "Writing empty json index file")
// Empty cores list
exitCode, d := executeWithArgs(t, "--config-file", configFile.String(), "core", "list")
require.Zero(t, exitCode, "exit code")
require.Empty(t, strings.TrimSpace(string(d)))
// Empty cores list
exitCode, _ = executeWithArgs(t, "--config-file", configFile.String(), "core", "update-index")
require.NotZero(t, exitCode, "exit code")
// Empty cores list
exitCode, d = executeWithArgs(t, "--config-file", configFile.String(), "core", "list")
require.Zero(t, exitCode, "exit code")
require.Empty(t, strings.TrimSpace(string(d)))
}
func TestCoreCommands(t *testing.T) {
defer makeTempDataDir(t)()
defer makeTempSketchbookDir(t)()
// Set staging dir to a temporary dir
tmp, err := ioutil.TempDir(os.TempDir(), "test")
require.NoError(t, err, "making temporary staging dir")
defer os.RemoveAll(tmp)
updateCoreIndex(t)
AVR := "arduino:avr@" + detectLatestAVRCore(t)
// Download a specific core version
exitCode, d := executeWithArgs(t, "core", "download", "arduino:[email protected]")
require.Zero(t, exitCode, "exit code")
require.Contains(t, string(d), "arduino:[email protected] downloaded")
require.Contains(t, string(d), "arduino:[email protected] downloaded")
require.Contains(t, string(d), "arduino:[email protected] downloaded")
require.Contains(t, string(d), "arduino:[email protected] downloaded")
// Download latest
exitCode, d = executeWithArgs(t, "core", "download", "arduino:avr")
require.Zero(t, exitCode, "exit code")
require.Contains(t, string(d), AVR+" downloaded")
// Wrong downloads
exitCode, d = executeWithArgs(t, "core", "download", "arduino:[email protected]")
require.NotZero(t, exitCode, "exit code")
require.Contains(t, string(d), "required version 1.2.3-notexisting not found for platform arduino:samd")
exitCode, d = executeWithArgs(t, "core", "download", "arduino:notexistent")
require.NotZero(t, exitCode, "exit code")
require.Contains(t, string(d), "not found")
exitCode, d = executeWithArgs(t, "core", "download", "wrongparameter")
require.NotZero(t, exitCode, "exit code")
require.Contains(t, string(d), "invalid item")
// Empty cores list
exitCode, d = executeWithArgs(t, "core", "list")
require.Zero(t, exitCode, "exit code")
require.Empty(t, strings.TrimSpace(string(d)))
// Install avr 1.6.16
exitCode, d = executeWithArgs(t, "core", "install", "arduino:[email protected]")
require.Zero(t, exitCode, "exit code")
require.Contains(t, string(d), "arduino:[email protected] installed")
exitCode, d = executeWithArgs(t, "core", "list")
require.Zero(t, exitCode, "exit code")
require.Contains(t, string(d), "arduino:avr")
require.Contains(t, string(d), "1.6.16")
exitCode, d = executeWithArgs(t, "core", "list", "--format", "json")
require.Zero(t, exitCode, "exit code")
require.Contains(t, string(d), "arduino:avr")
require.Contains(t, string(d), "1.6.16")
// Replace avr with 1.6.17
exitCode, d = executeWithArgs(t, "core", "install", "arduino:[email protected]")
require.Zero(t, exitCode, "exit code")
require.Contains(t, string(d), "Updating arduino:[email protected] with arduino:[email protected]")
require.Contains(t, string(d), "arduino:[email protected] installed")
exitCode, d = executeWithArgs(t, "core", "list")
require.Zero(t, exitCode, "exit code")
require.Contains(t, string(d), "arduino:avr")
require.Contains(t, string(d), "1.6.17")
// List updatable cores
exitCode, d = executeWithArgs(t, "core", "list", "--updatable")
require.Zero(t, exitCode, "exit code")
require.Contains(t, string(d), "arduino:avr")
exitCode, d = executeWithArgs(t, "core", "list", "--updatable", "--format", "json")
require.Zero(t, exitCode, "exit code")
require.Contains(t, string(d), "arduino:avr")
// Upgrade platform
exitCode, d = executeWithArgs(t, "core", "upgrade", "arduino:[email protected]")
require.NotZero(t, exitCode, "exit code")
require.Contains(t, string(d), "Invalid item arduino:[email protected]")
exitCode, d = executeWithArgs(t, "core", "upgrade", "other:avr")
require.NotZero(t, exitCode, "exit code")
require.Contains(t, string(d), "other:avr not found")
exitCode, d = executeWithArgs(t, "core", "upgrade", "arduino:samd")
require.NotZero(t, exitCode, "exit code")
require.Contains(t, string(d), "arduino:samd is not installed")
exitCode, d = executeWithArgs(t, "core", "upgrade", "arduino:avr")
require.Zero(t, exitCode, "exit code")
require.Contains(t, string(d), "Updating arduino:[email protected] with "+AVR)
// List updatable cores
exitCode, d = executeWithArgs(t, "core", "list", "--updatable")
require.Zero(t, exitCode, "exit code")
require.NotContains(t, string(d), "arduino:avr")
exitCode, d = executeWithArgs(t, "core", "list")
require.Zero(t, exitCode, "exit code")
require.Contains(t, string(d), "arduino:avr")
// Uninstall arduino:avr
exitCode, d = executeWithArgs(t, "core", "uninstall", "arduino:avr")
require.Zero(t, exitCode, "exit code")
require.Contains(t, string(d), AVR+" uninstalled")
// Empty cores list
exitCode, d = executeWithArgs(t, "core", "list")
require.Zero(t, exitCode, "exit code")
require.Empty(t, strings.TrimSpace(string(d)))
}