File tree 2 files changed +50
-0
lines changed
2 files changed +50
-0
lines changed Original file line number Diff line number Diff line change
1
+ !e
2
+ ;\p
3
+ Red [\p-->>]\pj
4
+ Red +[\p-->>]\pj
5
+ comment [\p-->>]\pj
6
+ comment +[\p-->>]\pj
7
+ comment {\p-->>}\pj
8
+ comment +{\p-->>}\pj
Original file line number Diff line number Diff line change
1
+ require "test_helper"
2
+
3
+ module SnippetExtractor
4
+ module Languages
5
+ class RedTest < Minitest ::Test
6
+ def test_full_example
7
+ code = <<~CODE
8
+ Red [] ; 20 lines 10 code 6 comments 4 blanks
9
+
10
+ x: 1 ; line comment 1
11
+ x: 2 ;-- line comment 2
12
+ x: 3 ;@@ line comment 3
13
+
14
+ comment ['this
15
+ 'is 'multiline
16
+ 'comment]
17
+ comment {and this
18
+ as well}
19
+
20
+ function add100 [x [integer!]] [
21
+ "; this should not count as comment "
22
+ { comment [and neither
23
+ this] }
24
+ ]
25
+ CODE
26
+
27
+ expected = <<~CODE
28
+ x: 1
29
+ x: 2
30
+ x: 3
31
+ function add100 [x [integer!]] [
32
+ "; this should not count as comment "
33
+ { comment [and neither
34
+ this] }
35
+ ]
36
+ CODE
37
+
38
+ assert_equal expected , ExtractSnippet . ( code , :red )
39
+ end
40
+ end
41
+ end
42
+ end
You can’t perform that action at this time.
0 commit comments