Skip to content

Commit e8f7454

Browse files
committed
JS: Add tests.
1 parent 3a90e8c commit e8f7454

3 files changed

Lines changed: 50 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
| comments.yml:1:1:1:22 | # leadi ... comment | leading file comment |
2+
| comments.yml:2:5:2:29 | # docum ... comment | document marker comment |
3+
| comments.yml:3:7:3:29 | #commen ... oot key | comment after root key |
4+
| comments.yml:4:3:4:42 | # inden ... roperty | indented comment before first property |
5+
| comments.yml:5:15:5:43 | # comme ... scalar | comment after quoted scalar |
6+
| comments.yml:6:10:6:46 | #commen ... l value | comment after an explicit null value |
7+
| comments.yml:7:9:7:32 | # comme ... ist key | comment after list key |
8+
| comments.yml:8:5:8:34 | # comme ... ce item | comment before sequence item |
9+
| comments.yml:9:13:9:50 | #commen ... mapping | comment after inline sequence mapping |
10+
| comments.yml:10:20:10:47 | # comme ... scalar | comment after plain scalar |
11+
| comments.yml:11:7:11:31 | # comme ... re dash | comment after bare dash |
12+
| comments.yml:12:13:12:51 | # comme ... equence | comment after mapping key in sequence |
13+
| comments.yml:13:21:13:42 | #commen ... boolean | comment after boolean |
14+
| comments.yml:14:27:14:55 | # comme ... equence | comment after flow sequence |
15+
| comments.yml:15:33:15:60 | # comme ... mapping | comment after flow mapping |
16+
| comments.yml:16:55:16:79 | # comme ... ow list | comment after flow list |
17+
| comments.yml:17:12:17:47 | #commen ... header | comment after literal scalar header |
18+
| comments.yml:20:13:20:47 | #commen ... header | comment after folded scalar header |
19+
| comments.yml:23:52:23:85 | # comme ... g value | comment after hash-looking value |
20+
| comments.yml:24:1:24:39 | # comme ... ent end | comment between body and document end |
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import javascript
2+
3+
from YamlComment c
4+
select c, c.getText()
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# leading file comment
2+
--- # document marker comment
3+
root: #comment after root key
4+
# indented comment before first property
5+
name: "odd" # comment after quoted scalar
6+
empty: #comment after an explicit null value
7+
list: # comment after list key
8+
# comment before sequence item
9+
- id: 1 #comment after inline sequence mapping
10+
label: plain # comment after plain scalar
11+
- # comment after bare dash
12+
id: 2 # comment after mapping key in sequence
13+
enabled: true #comment after boolean
14+
tags: [alpha, beta] # comment after flow sequence
15+
flow_map: {left: 1, right: 2} # comment after flow mapping
16+
flow_list: [first, second, "third # not a comment"] # comment after flow list
17+
block: | #comment after literal scalar header
18+
this line belongs to the scalar
19+
# this hash is text, not a YAML comment
20+
folded: > #comment after folded scalar header
21+
folded text with # also just text
22+
and another scalar line
23+
trailing_hash: "there is # no comment # in here" # comment after hash-looking value
24+
# comment between body and document end
25+
... # document end comment
26+
# final comment after document end

0 commit comments

Comments
 (0)