Pretty view now indents Javascript.

Thanks to the JSBeautifier project, which is now included in the contrib directory.
This commit is contained in:
Aldo Cortesi
2012-03-25 10:56:45 +13:00
parent 74c51df580
commit 2240d2a6a5
12 changed files with 1607 additions and 6 deletions

View File

@@ -9,7 +9,7 @@ class uContentView(libpry.AutoTree):
assert not txt
cv.trailer(cv.VIEW_CUTOFF + 10, txt)
assert txt
def test_get_view_func(self):
f = cv.get_view_func(
cv.VIEW_CONTENT_HEX,
@@ -75,6 +75,11 @@ class uContentView(libpry.AutoTree):
def test_view_raw(self):
assert cv.view_raw([], "foo")
def test_view_javascript(self):
assert cv.view_javascript([], "[1, 2, 3]")
assert cv.view_javascript([], "[1, 2, 3")
assert cv.view_javascript([], "function(a){[1, 2, 3]}")
def test_view_raw(self):
assert cv.view_hex([], "foo")