File tree 2 files changed +11
-1
lines changed
internal/arduino/builder/internal/detector
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 {
478
478
}
479
479
480
480
// includeRegexp fixdoc
481
- var includeRegexp = regexp .MustCompile (`(?ms)[<"' ](\S+)[">' ]` )
481
+ var includeRegexp = regexp .MustCompile (`#include[ \t]*[<" ](\S+)[">]` )
482
482
483
483
// IncludesFinderWithRegExp fixdoc
484
484
func IncludesFinderWithRegExp (source string ) string {
Original file line number Diff line number Diff line change @@ -75,3 +75,13 @@ func TestIncludesFinderWithRegExpPaddedIncludes4(t *testing.T) {
75
75
76
76
require .Equal (t , "register.h" , include )
77
77
}
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