@@ -380,3 +380,38 @@ func TestCompileWithBuildPropertiesFlag(t *testing.T) {
380380 require .Contains (t , string (stdout ), "-DFIRST_PIN=1" )
381381 require .Contains (t , string (stdout ), "-DSECOND_PIN=2" )
382382}
383+
384+ func TestCompileWithBuildPropertyContainingQuotes (t * testing.T ) {
385+ env , cli := integrationtest .CreateArduinoCLIWithEnvironment (t )
386+ defer env .CleanUp ()
387+
388+ // Init the environment explicitly
389+ _ , _ , err := cli .Run ("core" , "update-index" )
390+ require .NoError (t , err )
391+
392+ // Install Arduino AVR Boards
393+ _ , _ , err = cli .Run ("core" , "install" , "arduino:avr@1.8.3" )
394+ require .NoError (t , err )
395+
396+ // Copy sketch
397+ sketchName := "sketch_with_single_string_define"
398+ p , err := paths .Getwd ()
399+ require .NoError (t , err )
400+ require .NotNil (t , p )
401+ testSketch := p .Parent ().Join ("testdata" , sketchName )
402+ sketchPath := cli .SketchbookDir ().Join (sketchName )
403+ err = testSketch .CopyDirTo (sketchPath )
404+ require .NoError (t , err )
405+
406+ fqbn := "arduino:avr:uno"
407+
408+ // Compile using a build property with quotes
409+ stdout , _ , err := cli .Run ("compile" ,
410+ "-b" ,
411+ fqbn ,
412+ `--build-property=build.extra_flags="-DMY_DEFINE="hello world""` ,
413+ sketchPath .String (),
414+ "--verbose" )
415+ require .NoError (t , err )
416+ require .Contains (t , string (stdout ), `-DMY_DEFINE=\"hello world\"` )
417+ }
0 commit comments