Skip to content

Commit

Permalink
Added tests for newlines between chained methods
Browse files Browse the repository at this point in the history
Closes #892
  • Loading branch information
bitwiseman committed Jan 2, 2017
1 parent d963e9c commit 5952364
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
11 changes: 11 additions & 0 deletions js/test/generated/beautify-javascript-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -2471,6 +2471,17 @@ function run_javascript_tests(test_obj, Urlencoded, js_beautify, html_beautify,
' });\n' +
'}\n' +
'["navigating"].forEach(bindBrowserEvent);');

// Issue #892 - new line between chained methods
bt(
'foo\n' +
' .who()\n' +
'\n' +
' .knows()\n' +
' // comment\n' +
' .nothing() // comment\n' +
'\n' +
' .more()');


//============================================================
Expand Down
11 changes: 11 additions & 0 deletions python/jsbeautifier/tests/generated/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2299,6 +2299,17 @@ def unicode_char(value):
' });\n' +
'}\n' +
'["navigating"].forEach(bindBrowserEvent);')

# Issue #892 - new line between chained methods
bt(
'foo\n' +
' .who()\n' +
'\n' +
' .knows()\n' +
' // comment\n' +
' .nothing() // comment\n' +
'\n' +
' .more()')


#============================================================
Expand Down
13 changes: 13 additions & 0 deletions test/data/javascript/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -2234,6 +2234,19 @@ exports.test_data = {
'}',
'["navigating"].forEach(bindBrowserEvent);'
]
},
{
comment: "Issue #892 - new line between chained methods ",
unchanged: [
'foo',
' .who()',
'',
' .knows()',
' // comment',
' .nothing() // comment',
'',
' .more()'
]
}
]
}, {
Expand Down

0 comments on commit 5952364

Please sign in to comment.