File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
internal/arduino/builder/internal/detector Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -478,7 +478,7 @@ func (l *SketchLibrariesDetector) failIfImportedLibraryIsWrong() error {
478478}
479479
480480// includeRegexp fixdoc
481- var includeRegexp = regexp .MustCompile (`(?ms)[<"' ](\S+)[">' ]` )
481+ var includeRegexp = regexp .MustCompile (`#include[ \t]*[<" ](\S+)[">]` )
482482
483483// IncludesFinderWithRegExp fixdoc
484484func IncludesFinderWithRegExp (source string ) string {
Original file line number Diff line number Diff line change @@ -75,3 +75,13 @@ func TestIncludesFinderWithRegExpPaddedIncludes4(t *testing.T) {
7575
7676 require .Equal (t , "register.h" , include )
7777}
78+
79+ func TestIncludesFinderWithRegExpPaddedIncludes5 (t * testing.T ) {
80+ output := "/some/path/sketch.ino:23:42: fatal error: 'Foobar.h' file not found" +
81+ " 23 | #include \" Foobar.h\" " +
82+ " | ^~~~~~~~~~"
83+
84+ include := detector .IncludesFinderWithRegExp (output )
85+
86+ require .Equal (t , "Foobar.h" , include )
87+ }
You can’t perform that action at this time.
0 commit comments