Skip to content

Commit f18e7dd

Browse files
committed
Added test for c++ static_assert
see #68 Signed-off-by: Cristian Maglie <[email protected]>
1 parent 9d3dc9e commit f18e7dd

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// https://github.com/arduino/arduino-builder/issues/68
2+
3+
const int a = 10;
4+
const int b = 20;
5+
6+
static_assert(a < b, "bar");
7+
8+
void setup() {
9+
test();
10+
}
11+
12+
void loop() {
13+
}
14+
15+
void test() {
16+
}

Diff for: src/arduino.cc/builder/test/try_build_of_problematic_sketch_test.go

+4
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,10 @@ func TestTryBuild033(t *testing.T) {
177177
tryBuild(t, "sketch_that_includes_arduino_h", "sketch_that_includes_arduino_h.ino")
178178
}
179179

180+
func TestTryBuild034(t *testing.T) {
181+
tryBuild(t, "sketch_with_static_asserts", "sketch_with_static_asserts.ino")
182+
}
183+
180184
func makeDefaultContext(t *testing.T) map[string]interface{} {
181185
DownloadCoresAndToolsAndLibraries(t)
182186

0 commit comments

Comments
 (0)