c++-mode-expansions.feature (1223B)
1 Feature: C++-mode expansions 2 Background: 3 Given there is no region selected 4 And I turn on c++-mode 5 And I insert: 6 """ 7 #include <iostream> 8 9 namespace Foo { 10 struct Bar { 11 static float val (int x, double y) { return 42.; } 12 }; 13 } 14 15 int main (int argc, char **argv) { 16 int x = 0; 17 double y = 1.; 18 float z = Foo::Bar::val (x, y); 19 char t = argv [x + 3]; 20 21 int i = 0; 22 for ( ; i<N ; ++i ) { 23 doSomething (i); 24 } 25 } 26 """ 27 28 Scenario: Mark fully-qualified symbol 29 When I place the cursor after "Foo::Ba" 30 And I press "C-@" 31 Then the region should be "Bar" 32 And I press "C-@" 33 Then the region should be "Foo::Bar::val" 34 35 36 37 Scenario: Mark fully-qualified function call (1) 38 When I place the cursor after "Foo::Bar::va" 39 And I press "C-u 2 C-@" 40 Then the region should be "Foo::Bar::val" 41 And I press "C-@" 42 Then the region should be "Foo::Bar::val (x, y)" 43 44 Scenario: Mark fully-qualified function call (2) 45 When I place the cursor after "Foo::Bar::val (" 46 And I press "C-u 3 C-@" 47 Then the region should be "(x, y)" 48 And I press "C-@" 49 Then the region should be "Foo::Bar::val (x, y)"