8000 [skip-changelog] Improve the definition of FQBN and explicitly state which characters are allowed by MatteoPologruto · Pull Request #2509 · arduino/arduino-cli · GitHub
[go: up one dir, main page]

Skip to content

[skip-changelog] Improve the definition of FQBN and explicitly state which characters are allowed #2509

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
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
Test that an error is returned when the FQBN contains an invalid char…
…acter
  • Loading branch information
MatteoPologruto committed Feb 5, 2024
commit 0f4bcf22808483fbc320d8a26fe74e5fc7f0c783
15 changes: 15 additions & 0 deletions internal/arduino/cores/fqbn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,18 @@ func TestMatch(t *testing.T) {
require.False(t, b.Match(a))
}
}

func TestValidCharacters(t *testing.T) {
// These FQBNs contain valid characters
validFqbns := []string{"ardui_no:av_r:un_o", "arduin.o:av.r:un.o", "arduin-o:av-r:un-o", "arduin-o:av-r:un-o:a=b=c=d"}
for _, fqbn := range validFqbns {
_, err := ParseFQBN(fqbn)
require.NoError(t, err)
}
// These FQBNs contain invalid characters
invalidFqbns := []string{"arduin-o:av-r:un=o", "arduin?o:av-r:uno", "arduino:av*r:uno"}
for _, fqbn := range invalidFqbns {
_, err := ParseFQBN(fqbn)
require.Error(t, err)
}
}
0