@@ -702,6 +702,24 @@ defmodule Kernel.ParserTest do
702702 ] }
703703 end
704704
705+ test "adds opening and closing information for tuples" do
706+ string_to_quoted = & Code . string_to_quoted! ( & 1 , token_metadata: true , columns: true )
707+
708+ assert string_to_quoted . ( "{}" ) ==
709+ { :{} , [ closing: [ line: 1 , column: 2 ] , line: 1 , column: 1 ] , [ ] }
710+
711+ assert string_to_quoted . ( "{123}" ) ==
712+ { :{} , [ closing: [ line: 1 , column: 5 ] , line: 1 , column: 1 ] , [ 123 ] }
713+
714+ assert string_to_quoted . ( "x.{}" ) ==
715+ { { :. , [ line: 1 , column: 2 ] , [ { :x , [ line: 1 , column: 1 ] , nil } , :{} ] } ,
716+ [ closing: [ line: 1 , column: 4 ] , line: 1 , column: 2 ] , [ ] }
717+
718+ assert string_to_quoted . ( "x.{123}" ) ==
719+ { { :. , [ line: 1 , column: 2 ] , [ { :x , [ line: 1 , column: 1 ] , nil } , :{} ] } ,
720+ [ closing: [ line: 1 , column: 7 ] , line: 1 , column: 2 ] , [ 123 ] }
721+ end
722+
705723 test "adds opening and closing information for empty block" do
706724 string_to_quoted =
707725 & Code . string_to_quoted! ( & 1 , token_metadata: true , columns: true , emit_warnings: false )
0 commit comments