Skip to content

Commit 2509978

Browse files
committed
Update tests to reflect new single-line token (#)
1 parent 57611a7 commit 2509978

File tree

3 files changed

+79
-70
lines changed

3 files changed

+79
-70
lines changed

test/corpus/misc.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ Comments
66
still
77
*/ UPDATE FILE '' DELETE 1
88

9-
-- Comment
10-
CREATE FILE 'a--b'
9+
# Comment
10+
CREATE FILE 'a--b#c##d'
1111
WITH CONTENT '''
1212
/* content */
13-
a -- content --
13+
a -- content --
14+
b # content #
1415
'''
1516

1617
---

test/corpus/update/move.case.txt

Lines changed: 70 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -11,73 +11,81 @@ INSERT BEFORE 1
1111
WHEN EMPTY THEN REMOVE
1212
WHEN LINE "asdf" THEN BREAK
1313
WHEN "asdf" THEN BREAK
14-
WHEN 5 THEN SUB r"pattern" r"replacement" BREAK
15-
ELSE SUB r"pattern" r'replacement'
14+
WHEN 5 THEN SUB
15+
r"pattern" # Comment
16+
r"replacement"
17+
BREAK
18+
ELSE SUB
19+
r"pattern" # Comment
20+
r'replacement' # Comments
1621
END;
1722

1823
---
1924

20-
(source_file
21-
(update_command
22-
(singlefile_clause
23-
(string
24-
(single_quoted_string)))
25-
(update_move_mos_clause
26-
(marker_or_segment
27-
(segment
28-
(relpos_segment_start
29-
(relpos_at
30-
(marker
31-
(line_matcher
32-
(line_base
33-
(number))))))
34-
(relpos_segment_end
35-
(relpos_beforeafter
36-
(marker
37-
(line_matcher
38-
(line_base
39-
(number))))))))
40-
(update_move_clause_destination
41-
(insert_clause
42-
(relpos_bai
43-
(relpos_beforeafter
44-
(marker
45-
(line_matcher
46-
(line_base
47-
(number)))))))
48-
(relative_indentation
25+
(source_file
26+
(update_command
27+
(singlefile_clause
28+
(string
29+
(single_quoted_string)))
30+
(update_move_mos_clause
31+
(marker_or_segment
32+
(segment
33+
(relpos_segment_start
34+
(relpos_at
35+
(marker
36+
(line_matcher
37+
(line_base
38+
(number))))))
39+
(relpos_segment_end
40+
(relpos_beforeafter
41+
(marker
42+
(line_matcher
43+
(line_base
44+
(number))))))))
45+
(update_move_clause_destination
46+
(insert_clause
47+
(relpos_bai
48+
(relpos_beforeafter
49+
(marker
50+
(line_matcher
51+
(line_base
52+
(number)))))))
53+
(relative_indentation
54+
(number))
55+
(line_filter
56+
(case_stmt
57+
(line_base)
58+
(case_action)
59+
(line_base
60+
(string
61+
(single_quoted_string)))
62+
(case_action
63+
(loop_control
64+
(loop_break)))
65+
(line_base
66+
(string
67+
(single_quoted_string)))
68+
(case_action
69+
(loop_control
70+
(loop_break)))
71+
(line_base
4972
(number))
50-
(line_filter
51-
(case_stmt
52-
(line_base)
53-
(case_action)
54-
(line_base
55-
(string
56-
(single_quoted_string)))
57-
(case_action
58-
(loop_control
59-
(loop_break)))
60-
(line_base
61-
(string
62-
(single_quoted_string)))
63-
(case_action
64-
(loop_control
65-
(loop_break)))
66-
(line_base
67-
(number))
68-
(case_action
69-
(string
70-
(raw_string))
71-
(string
72-
(raw_string))
73-
(loop_control
74-
(loop_break)))
75-
(case_action
76-
(string
77-
(raw_string))
78-
(string
79-
(raw_string))))))))
80-
(command_separator))
73+
(case_action
74+
(string
75+
(raw_string))
76+
(comment)
77+
(string
78+
(raw_string))
79+
(loop_control
80+
(loop_break)))
81+
(case_action
82+
(string
83+
(raw_string))
84+
(comment)
85+
(string
86+
(raw_string)))
87+
(comment))))))
88+
(command_separator))
8189

8290
==================
8391
UPDATE Identifier Move WHOLE CASE filter

test/corpus/update/single-file.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
UPDATE Single File
33
==================
44

5-
-- Remarks
5+
# Remarks
66
UPDATE FILE "/path/to/file.js"
77
REPLACE LINE "old" WITH CONTENT "new line content";
88

@@ -20,8 +20,8 @@ WITH CONTENT """
2020
def other_function(x):
2121
"""
2222

23-
UPDATE FILE "file" REPLACE WHOLE WITH CONTENT "Single line"; -- Preferred
24-
UPDATE FILE "file" REPLACE BODY WITH CONTENT "Single line"; -- Synonym
23+
UPDATE FILE "file" REPLACE WHOLE WITH CONTENT "Single line"; # Preferred
24+
UPDATE FILE "file" REPLACE BODY WITH CONTENT "Single line"; # Synonym
2525

2626
UPDATE FILE "/config/settings.json"
2727
REPLACE SEGMENT
@@ -59,8 +59,8 @@ DELETE SEGMENT
5959
STARTING AT LINE "\"database\": {" OFFSET 1
6060
ENDING BEFORE LINE "}";
6161

62-
UPDATE FILE "file" DELETE WHOLE -- Preferred;
63-
UPDATE FILE "file" DELETE BODY -- Synonym;
62+
UPDATE FILE "file" DELETE WHOLE # Preferred;
63+
UPDATE FILE "file" DELETE BODY # Synonym;
6464

6565
---
6666

0 commit comments

Comments
 (0)