Skip to content

Fix path in error messages on sketch loading #1805

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 18, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updated unit-test
  • Loading branch information
cmaglie committed Jul 14, 2022
commit b8f51e8087a657e4242faffd67d3f2d0c92eca20
5 changes: 2 additions & 3 deletions arduino/sketch/sketch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,15 @@ func TestNewSketchWrongMain(t *testing.T) {
require.Error(t, err)
sketchFolderPath, _ = sketchFolderPath.Abs()
expectedMainFile := sketchFolderPath.Join(sketchName)
expectedError := fmt.Sprintf("no valid sketch found in %s: missing %s", sketchFolderPath, expectedMainFile)
expectedError := fmt.Sprintf("main file missing from sketch: %s", expectedMainFile)
require.Contains(t, err.Error(), expectedError)

sketchFolderPath = paths.New("testdata", sketchName)
mainFilePath := sketchFolderPath.Join(fmt.Sprintf("%s.ino", sketchName))
sketch, err = New(mainFilePath)
require.Nil(t, sketch)
require.Error(t, err)
sketchFolderPath, _ = sketchFolderPath.Abs()
expectedError = fmt.Sprintf("no valid sketch found in %s: missing %s", sketchFolderPath, expectedMainFile)
expectedError = fmt.Sprintf("main file missing from sketch: %s", expectedMainFile)
require.Contains(t, err.Error(), expectedError)
}

Expand Down