From 1f76e42b85be4031bdedcc3e457e8fa949195304 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 25 Aug 2023 02:20:39 +0900 Subject: [Bug #19848] Flush BOM The token just after BOM needs to position at column 0, so that the indentation matches closing line. --- test/ruby/test_ast.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_ast.rb b/test/ruby/test_ast.rb index 8b565f531d..b4bcc03cfe 100644 --- a/test/ruby/test_ast.rb +++ b/test/ruby/test_ast.rb @@ -1082,6 +1082,12 @@ dummy assert_equal([[0, :backslash, "\\", [1, 0, 1, 1]]], node.children.last.tokens) end + def test_with_bom + assert_error_tolerant("\u{feff}nil", <<~EXP) + (SCOPE@1:0-1:3 tbl: [] args: nil body: (NIL@1:0-1:3)) + EXP + end + def assert_error_tolerant(src, expected, keep_tokens: false) begin verbose_bak, $VERBOSE = $VERBOSE, false -- cgit v1.2.3