@@ -880,3 +880,44 @@ func TestPrototypesAdderSketchWithConst(t *testing.T) {
880880 require .Equal (t , "#include <Arduino.h>\n #line 1\n " , context [constants .CTX_INCLUDE_SECTION ].(string ))
881881 require .Equal (t , "#line 1 \" " + absoluteSketchLocation + "\" \n void setup();\n #line 2 \" " + absoluteSketchLocation + "\" \n void loop();\n #line 4 \" " + absoluteSketchLocation + "\" \n const __FlashStringHelper* test();\n #line 6 \" " + absoluteSketchLocation + "\" \n const int test3();\n #line 8 \" " + absoluteSketchLocation + "\" \n volatile __FlashStringHelper* test2();\n #line 10 \" " + absoluteSketchLocation + "\" \n volatile int test4();\n #line 1\n " , context [constants .CTX_PROTOTYPE_SECTION ].(string ))
882882}
883+
884+ func TestPrototypesAdderSketchWithDosEol (t * testing.T ) {
885+ DownloadCoresAndToolsAndLibraries (t )
886+
887+ context := make (map [string ]interface {})
888+
889+ buildPath := SetupBuildPath (t , context )
890+ defer os .RemoveAll (buildPath )
891+
892+ sketchLocation := filepath .Join ("eol_processing" , "sketch.ino" )
893+
894+ context [constants .CTX_HARDWARE_FOLDERS ] = []string {filepath .Join (".." , "hardware" ), "hardware" , "downloaded_hardware" }
895+ context [constants .CTX_TOOLS_FOLDERS ] = []string {"downloaded_tools" }
896+ context [constants .CTX_FQBN ] = "arduino:avr:uno"
897+ context [constants .CTX_SKETCH_LOCATION ] = sketchLocation
898+ context [constants .CTX_BUILD_PROPERTIES_RUNTIME_IDE_VERSION ] = "10600"
899+ context [constants .CTX_BUILT_IN_LIBRARIES_FOLDERS ] = []string {"downloaded_libraries" }
900+ context [constants .CTX_OTHER_LIBRARIES_FOLDERS ] = []string {"libraries" }
901+ context [constants .CTX_VERBOSE ] = true
902+
903+ commands := []types.Command {
904+ & builder.SetupHumanLoggerIfMissing {},
905+
906+ & builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
907+
908+ & builder.ContainerMergeCopySketchFiles {},
909+
910+ & builder.ContainerFindIncludes {},
911+
912+ & builder.PrintUsedLibrariesIfVerbose {},
913+ & builder.WarnAboutArchIncompatibleLibraries {},
914+
915+ & builder.ContainerAddPrototypes {},
916+ }
917+
918+ for _ , command := range commands {
919+ err := command .Run (context )
920+ NoError (t , err )
921+ }
922+ // only requires no error as result
923+ }
0 commit comments