Skip to content

Commit cae3c8c

Browse files
committed
Add YAML fixtures for Regexp encoding options
1 parent d88c8fc commit cae3c8c

File tree

4 files changed

+49
-0
lines changed

4 files changed

+49
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
subject: "Regexp"
2+
description: "encoding options / with e option"
3+
note: >
4+
The 'e' modifiers overrides source encoding with EUC-JP encoding
5+
focused_on_node: "org.truffleruby.language.literal.ObjectLiteralNode"
6+
ruby: |
7+
/abc/e
8+
ast: |
9+
ObjectLiteralNode
10+
attributes:
11+
flags = 1
12+
object = RubyRegexp(source = abc, options = RegexpOptions(kcode: EUC, fixed, literal), encoding = EUC-JP)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
subject: "Regexp"
2+
description: "encoding options / with n option"
3+
note: >
4+
The 'n' modifiers overrides source encoding with US-ASCII encoding.
5+
According to the documentation it should be ASCII-8BIT encoding actually.
6+
focused_on_node: "org.truffleruby.language.literal.ObjectLiteralNode"
7+
ruby: |
8+
/abc/n
9+
ast: |
10+
ObjectLiteralNode
11+
attributes:
12+
flags = 1
13+
object = RubyRegexp(source = abc, options = RegexpOptions(kcode: NONE, encodingNone, literal), encoding = US-ASCII)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
subject: "Regexp"
2+
description: "encoding options / with s option"
3+
note: >
4+
The 's' modifiers overrides source encoding with Windows-31J encoding
5+
focused_on_node: "org.truffleruby.language.literal.ObjectLiteralNode"
6+
ruby: |
7+
/abc/s
8+
ast: |
9+
ObjectLiteralNode
10+
attributes:
11+
flags = 1
12+
object = RubyRegexp(source = abc, options = RegexpOptions(kcode: SJIS, fixed, literal), encoding = Windows-31J)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
subject: "Regexp"
2+
description: "encoding options / with u option"
3+
note: >
4+
The 'u' modifiers overrides source encoding with UTF-8 encoding
5+
focused_on_node: "org.truffleruby.language.literal.ObjectLiteralNode"
6+
ruby: |
7+
/abc/u
8+
ast: |
9+
ObjectLiteralNode
10+
attributes:
11+
flags = 1
12+
object = RubyRegexp(source = abc, options = RegexpOptions(kcode: UTF8, fixed, literal), encoding = UTF-8)

0 commit comments

Comments
 (0)