Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

fix testcases #90

Merged
merged 3 commits into from

2 participants

@nixon

Two testcases were failing due to code changes that modified the output.

  • Commit 170f752 changed the output to an html5 self-closing tag style
  • Commit f594060 removed the button synonym

This pull request updates the expected testcases to reflect these changes.

nixon added some commits
@nixon nixon return number of testcase failures
allow `git bisect` to know whether or not all tests passed.
7010319
@nixon nixon test for html5 self-closing tags
Commit 170f752 changed the output to an html self-closing tag style
causing the Short testcase to fail:

```
 - Shortcut test                  [FAIL]
= input:button
Actual output (condensed):
 | '<input type="button" class="button" value="$1" name="$2">$0'
Actual output:
 | <input type="button" class="button" value="$1" name="$2">$0
Expected:
 | <input type="button" class="button" value="$1" name="$2" />$0
```

Update the testcase so that it matches the new output.
262c9bf
@nixon nixon fix button testcase
Commit f594060 removed the button synonym which caused the Shortcut
synonym testcase to fail:

```
 - Shortcut synonym test          [FAIL]
= button
Actual output (condensed):
 | '<button>$1</button>$0'
Actual output:
 | <button>$1</button>$0
Expected:
 | <input type="button" class="button" value="$1" name="$2" />$0
```

Update test case so that it matches actual desired button output.
9bc9b3d
@faceleg faceleg merged commit 4cd3787 into rstacruz:master
@nixon nixon deleted the nixon:fix_tests branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 20, 2013
  1. @nixon

    return number of testcase failures

    nixon authored
    allow `git bisect` to know whether or not all tests passed.
  2. @nixon

    test for html5 self-closing tags

    nixon authored
    Commit 170f752 changed the output to an html self-closing tag style
    causing the Short testcase to fail:
    
    ```
     - Shortcut test                  [FAIL]
    = input:button
    Actual output (condensed):
     | '<input type="button" class="button" value="$1" name="$2">$0'
    Actual output:
     | <input type="button" class="button" value="$1" name="$2">$0
    Expected:
     | <input type="button" class="button" value="$1" name="$2" />$0
    ```
    
    Update the testcase so that it matches the new output.
  3. @nixon

    fix button testcase

    nixon authored
    Commit f594060 removed the button synonym which caused the Shortcut
    synonym testcase to fail:
    
    ```
     - Shortcut synonym test          [FAIL]
    = button
    Actual output (condensed):
     | '<button>$1</button>$0'
    Actual output:
     | <button>$1</button>$0
    Expected:
     | <input type="button" class="button" value="$1" name="$2" />$0
    ```
    
    Update test case so that it matches actual desired button output.
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 3 deletions.
  1. +8 −3 sparkup-unittest.py
View
11 sparkup-unittest.py
@@ -45,11 +45,11 @@ class SparkupTest:
},
'Shortcut test': {
'input': 'input:button',
- 'output': '<input type="button" class="button" value="$1" name="$2" />$0'
+ 'output': '<input type="button" class="button" value="$1" name="$2">$0'
},
'Shortcut synonym test': {
'input': 'button',
- 'output': '<input type="button" class="button" value="$1" name="$2" />$0'
+ 'output': '<button>$1</button>$0',
},
'Child test': {
'input': 'div>ul>li',
@@ -105,8 +105,10 @@ class SparkupTest:
},
# Add: text test, broken test, multi-attribute tests, indentation test, start and end comments test
}
+
def run(self):
"""Run Forrest run!"""
+ failures = 0
print "Test results:"
for name, case in self.cases.iteritems():
@@ -129,6 +131,7 @@ def run(self):
print " - %-30s [%s]" % (name, result_str)
if not result:
+ failures += 1
print "= %s" % input.replace("\n", "\n= ")
print "Actual output (condensed):"
print " | '%s'" % output.replace("\n", r"\n").replace('"', '\"')
@@ -137,6 +140,8 @@ def run(self):
print "Expected:"
print " | %s" % case['output'].replace("\n", "\ n| ")
+ return failures
+
if __name__ == '__main__':
s = SparkupTest()
- s.run()
+ sys.exit(s.run())
Something went wrong with that request. Please try again.