Skip to content

Commit 4a7d06b

Browse files
committed
Add test case for pair-key followed by a newline
1 parent cbd998c commit 4a7d06b

File tree

2 files changed

+85
-3
lines changed

2 files changed

+85
-3
lines changed

test/corpus/expressions.txt

Lines changed: 81 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,7 @@ method call with keyword args
998998
foo(a: true)
999999
foo a: true
10001000
foo B: true
1001-
foo a:
1001+
foo a: ;
10021002
foo B:
10031003

10041004
---
@@ -1565,6 +1565,86 @@ render "foo/bars/show", locals: { display_text: dt, safe_text: "hello" }
15651565
(call (identifier) (argument_list (string (string_content)) (pair (hash_key_symbol) (hash (pair (hash_key_symbol) (identifier)) (pair (hash_key_symbol) (string (string_content)))))))
15661566
)
15671567

1568+
========================================================================
1569+
call with keyword argument on different lines
1570+
========================================================================
1571+
1572+
render :show_details, 5,
1573+
description:
1574+
"Some long " \
1575+
"piece of text.",
1576+
dark_mode: false
1577+
1578+
render "/foo/bar", params:
1579+
{
1580+
id: 3,
1581+
title: "Hello world"
1582+
},
1583+
headers: { Accept: "text/html" }
1584+
1585+
render "/foo/bar", params:
1586+
{
1587+
id: 3,
1588+
title: "Hello world"
1589+
}
1590+
1591+
---
1592+
1593+
(program
1594+
(call
1595+
method: (identifier)
1596+
arguments: (argument_list
1597+
(simple_symbol)
1598+
(integer)
1599+
(pair
1600+
key: (hash_key_symbol)
1601+
value: (chained_string
1602+
(string
1603+
(string_content))
1604+
(string
1605+
(string_content))))
1606+
(pair
1607+
key: (hash_key_symbol)
1608+
value: (false))))
1609+
(call
1610+
method: (identifier)
1611+
arguments: (argument_list
1612+
(string
1613+
(string_content))
1614+
(pair
1615+
key: (hash_key_symbol)
1616+
value: (hash
1617+
(pair
1618+
key: (hash_key_symbol)
1619+
value: (integer))
1620+
(pair
1621+
key: (hash_key_symbol)
1622+
value: (string
1623+
(string_content)))))
1624+
(pair
1625+
key: (hash_key_symbol)
1626+
value: (hash
1627+
(pair
1628+
key: (hash_key_symbol)
1629+
value: (string
1630+
(string_content)))))))
1631+
(call
1632+
method: (identifier)
1633+
arguments: (argument_list
1634+
(string
1635+
(string_content))
1636+
(pair
1637+
key: (hash_key_symbol)
1638+
value: (hash
1639+
(pair
1640+
key: (hash_key_symbol)
1641+
value: (integer))
1642+
(pair
1643+
key: (hash_key_symbol)
1644+
value: (string
1645+
(string_content))))))))
1646+
1647+
15681648
==============
15691649
empty lambda expression
15701650
==============

test/corpus/literals.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,8 +1404,10 @@ hash with keyword keys
14041404
======================
14051405

14061406
{ a: 1, b: 2, "c": 3 }
1407-
{a:1, B:2, "c":3 }
1408-
{ a:, B: }
1407+
{a:
1408+
1, B:2, "c":3 }
1409+
{ a:, B:
1410+
}
14091411

14101412
---
14111413

0 commit comments

Comments
 (0)