/
cperl-mode-expansions.feature
78 lines (72 loc) · 1.58 KB
/
cperl-mode-expansions.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
Feature: cperl-mode expansions
In order to quickly and precisely mark perl variable names
As an Emacs user
I want to expand to them
Scenario: Mark perl variable name
Given I turn on cperl-mode
And there is no region selected
When I insert:
"""
my $foo = "bar";
"""
And I place the cursor after "$f"
And I press "C-@"
And I press "C-@"
Then the region should be:
"""
$foo
"""
Scenario: Mark interpolated perl variable name
Given I turn on cperl-mode
And there is no region selected
When I insert:
"""
my $foo = "something $bar here";
"""
And I place the cursor after "something "
And I press "C-@"
Then the region should be:
"""
$bar
"""
Scenario: Mark perl package name
Given I turn on cperl-mode
And there is no region selected
When I insert:
"""
Namespace::Foo::Bar::method_call($baz);
"""
And I place the cursor before "::Foo"
And I press "C-@"
And I press "C-@"
Then the region should be:
"""
Namespace::Foo::Bar
"""
Scenario: Mark one perl subroutine
Given I turn on cperl-mode
And there is no region selected
When I insert:
"""
sub foo {
foo_do_something;
}
sub bar {
bar_do_something;
}
sub baz {
baz_do_something;
}
"""
And I place the cursor before "foo_do_something"
And I press "C-@"
And I press "C-@"
And I press "C-@"
And I press "C-@"
And I press "C-@"
Then the region should be:
"""
sub foo {
foo_do_something;
}
"""