File tree Expand file tree Collapse file tree 7 files changed +31
-7
lines changed Expand file tree Collapse file tree 7 files changed +31
-7
lines changed Original file line number Diff line number Diff line change @@ -24,8 +24,8 @@ Feature: Correct window setup
24
24
"""
25
25
And I start the debugger with the PHP script example.php
26
26
When I step over
27
- Then the watch window should show the variable $var1
28
- And the watch window should show the variable $var2
27
+ Then the watch window should show $var1
28
+ And the watch window should show $var2
29
29
And the watch window variable $var1 should be (int) 1
30
30
And the watch window variable $var2 should be (uninitialized)
31
31
Original file line number Diff line number Diff line change
1
+ Feature : Evaluating expressions
2
+ In order to evaluate variables in Vdebug
3
+ As a user
4
+ I want to see the evaluated variable in the watch window
5
+
6
+ Scenario : Evaluating a PHP expression
7
+ Given I have a file example.php containing
8
+ """
9
+ <?php
10
+ $var1 = 1;
11
+ ?>
12
+ """
13
+ And I start the debugger with the PHP script example.php
14
+ When I evaluate $var1
15
+ Then the watch window should show Eval of: '$var1'
Original file line number Diff line number Diff line change
1
+ When "I evaluate $expression" do |expr |
2
+ vdebug . evaluate expr
3
+ vdebug . running? . should be ( true ) , 'Vdebug is not running'
4
+ end
Original file line number Diff line number Diff line change 1
- Then "the watch window should show the variable $var " do |var |
2
- vdebug . watch_window_content . should include var
1
+ Then "the watch window should show $text " do |text |
2
+ vdebug . watch_window_content . should include text
3
3
end
4
4
5
5
Then "the watch window variable $var should be $value" do |var , value |
Original file line number Diff line number Diff line change @@ -12,4 +12,4 @@ Feature: Unicode in source buffer
12
12
"""
13
13
And I start the debugger with the PHP script test.php
14
14
When I step over
15
- Then the watch window should show the variable $arr
15
+ Then the watch window should show $arr
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ Feature: Valid file names
12
12
"""
13
13
And I start the debugger with the PHP script My File.php
14
14
When I step over
15
- Then the watch window should show the variable $var
15
+ Then the watch window should show $var
16
16
17
17
Scenario : Debug a PHP file with a space in the directory
18
18
Given I have a file A Path/myfile.php containing
@@ -23,4 +23,4 @@ Feature: Valid file names
23
23
"""
24
24
And I start the debugger with the PHP script A Path/myfile.php
25
25
When I step over
26
- Then the watch window should show the variable $var
26
+ Then the watch window should show $var
Original file line number Diff line number Diff line change @@ -30,6 +30,11 @@ def step_in
30
30
vim . command 'python debugger.step_into()'
31
31
end
32
32
33
+ def evaluate ( expression )
34
+ safe_expression = expression . gsub ( /['"\\ \x0 ]/ , '\\\\\0' )
35
+ vim . command %Q{python debugger.handle_eval("#{ safe_expression } ")}
36
+ end
37
+
33
38
# Retrieve a hash with the buffer names (values) and numbers (keys)
34
39
def buffers
35
40
@buffers ||= fetch_buffers
You can’t perform that action at this time.
0 commit comments