Permalink
Browse files

Added test for #12. Passes.

  • Loading branch information...
ralphbean committed May 9, 2012
1 parent 1379196 commit b6bbf92a4ff87135dcc2a4af23b0bef7e677a125
Showing with 12 additions and 0 deletions.
  1. +12 −0 tests/test_js.py
@@ -68,3 +68,15 @@ def test_quotes_tripled(self):
f = twc.js_callback("""function() { return "c"; }""")
json = self.encode({'onLoad': f})
eq_(json, '{"onLoad": function() { return "c"; }}')
def test_multiline_js(self):
""" https://github.com/toscawidgets/tw2.core/issues/12 """
raw = """
$(document).ready(function() {
console.log("This is multiline javascript");
});
"""
expected = '{"onLoad": %s}' % raw
f = js_symbol(raw)
json = self.encode({'onLoad': f})
eq_(json, expected)

0 comments on commit b6bbf92

Please sign in to comment.