@@ -658,3 +658,43 @@ func TestPrototypesAdderSketchWithUSBCON(t *testing.T) {
658658require .Equal (t ,"#include <Arduino.h>\n #line 1\n " ,context [constants .CTX_INCLUDE_SECTION ].(string ))
659659require .Equal (t ,"void ciao();\n void setup();\n void loop();\n #line 3\n " ,context [constants .CTX_PROTOTYPE_SECTION ].(string ))
660660}
661+
662+ func TestPrototypesAdderSketchWithTypename (t * testing.T ) {
663+ DownloadCoresAndToolsAndLibraries (t )
664+
665+ context := make (map [string ]interface {})
666+
667+ buildPath := SetupBuildPath (t ,context )
668+ defer os .RemoveAll (buildPath )
669+
670+ context [constants .CTX_HARDWARE_FOLDERS ]= []string {filepath .Join (".." ,"hardware" ),"hardware" ,"downloaded_hardware" }
671+ context [constants .CTX_TOOLS_FOLDERS ]= []string {"downloaded_tools" }
672+ context [constants .CTX_FQBN ]= "arduino:avr:leonardo"
673+ context [constants .CTX_SKETCH_LOCATION ]= filepath .Join ("sketch_with_typename" ,"sketch.ino" )
674+ context [constants .CTX_BUILD_PROPERTIES_RUNTIME_IDE_VERSION ]= "10600"
675+ context [constants .CTX_LIBRARIES_FOLDERS ]= []string {"libraries" ,"downloaded_libraries" }
676+ context [constants .CTX_VERBOSE ]= true
677+
678+ commands := []types.Command {
679+ & builder.SetupHumanLoggerIfMissing {},
680+
681+ & builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
682+
683+ & builder.ContainerMergeCopySketchFiles {},
684+
685+ & builder.ContainerFindIncludes {},
686+
687+ & builder.PrintUsedLibrariesIfVerbose {},
688+ & builder.WarnAboutArchIncompatibleLibraries {},
689+
690+ & builder.ContainerAddPrototypes {},
691+ }
692+
693+ for _ ,command := range commands {
694+ err := command .Run (context )
695+ NoError (t ,err )
696+ }
697+
698+ require .Equal (t ,"#include <Arduino.h>\n #line 1\n " ,context [constants .CTX_INCLUDE_SECTION ].(string ))
699+ require .Equal (t ,"void setup();\n void loop();\n #line 6\n " ,context [constants .CTX_PROTOTYPE_SECTION ].(string ))
700+ }