From 17b6fe064c3e93df5561fa181e191f37ea7f0bbf Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Wed, 10 Jun 2009 09:01:00 -0400 Subject: Expand tabs to spaces before creating HTML output. Fixes bug #6. --- test/farm/html/run_tabbed.py | 18 ++++++++++++++++++ test/farm/html/src/tabbed.py | 8 ++++++++ 2 files changed, 26 insertions(+) create mode 100644 test/farm/html/run_tabbed.py create mode 100644 test/farm/html/src/tabbed.py (limited to 'test') diff --git a/test/farm/html/run_tabbed.py b/test/farm/html/run_tabbed.py new file mode 100644 index 00000000..c49bdfbd --- /dev/null +++ b/test/farm/html/run_tabbed.py @@ -0,0 +1,18 @@ +def html_it(): + """Run coverage and make an HTML report for tabbed.""" + import coverage + cov = coverage.coverage() + cov.start() + import tabbed + cov.stop() + cov.html_report(tabbed, directory="../html") + +runfunc(html_it, rundir="src") + +# Editors like to change things, make sure our source file still has tabs. +contains("src/tabbed.py", "\tif x:\t\t\t\t\t\t# look nice") + +contains("html/tabbed.html", + "

    if x:                       # look nice

") +doesnt_contain("html/tabbed.html", "\t") +clean("html") diff --git a/test/farm/html/src/tabbed.py b/test/farm/html/src/tabbed.py new file mode 100644 index 00000000..fe426115 --- /dev/null +++ b/test/farm/html/src/tabbed.py @@ -0,0 +1,8 @@ +# This file should have tabs. +x = 1 +if x: + a = "Tabbed" # Aligned comments + if x: # look nice + b = "No spaces" # when they + c = "Done" # line up. + -- cgit v1.2.1