Skip to content

Commit d597ba9

Browse files
committed
expand tests for expressions in templates
Signed-off-by: Martino Facchin <[email protected]>
1 parent 34d5b8d commit d597ba9

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/arduino.cc/builder/test/ctags_runner_test.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,10 @@ func TestCTagsRunnerSketchWithTemplates(t *testing.T) {
271271
}
272272

273273
sketchLocation = strings.Replace(sketchLocation, "\\", "\\\\", -1)
274-
expectedOutput := "printGyro\t" + sketchLocation + "\t/^void printGyro()$/;\"\tkind:function\tline:10\tsignature:()\treturntype:void\n"
274+
expectedOutput := "printGyro\t" + sketchLocation + "\t/^void printGyro()$/;\"\tkind:function\tline:10\tsignature:()\treturntype:void\n" +
275+
"bVar\t" + sketchLocation + "\t/^c< 8 > bVar;$/;\"\tkind:variable\tline:15\n" +
276+
"aVar\t" + sketchLocation + "\t/^c< 1<<8 > aVar;$/;\"\tkind:variable\tline:16\n" +
277+
"func\t" + sketchLocation + "\t/^template<int X> func( c< 1<<X> & aParam) {$/;\"\tkind:function\tline:18\tsignature:( c< 1<<X> & aParam)\treturntype:template\n"
275278

276279
require.Equal(t, expectedOutput, strings.Replace(context[constants.CTX_CTAGS_OUTPUT].(string), "\r\n", "\n", -1))
277280
}

src/arduino.cc/builder/test/sketch_with_templates_and_shift/template_and_shift.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,10 @@ template <class SomeType, template <class> class OtherType> class NestedTemplate
1010
void printGyro()
1111
{
1212
}
13+
14+
template <int P> class c {};
15+
c< 8 > bVar;
16+
c< 1<<8 > aVar;
17+
18+
template<int X> func( c< 1<<X> & aParam) {
19+
}

0 commit comments

Comments
 (0)