improved comment formatting for Python
This commit is contained in:
parent
1883797742
commit
29d1bba70a
10 changed files with 213 additions and 140 deletions
24
Examples/test-suite/python/commentVerifier.py
Normal file
24
Examples/test-suite/python/commentVerifier.py
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
|
||||
def check(got, expected):
|
||||
#if got is Null
|
||||
# raise RuntimeError('Expected comment string\n')
|
||||
#gotStr = string.replace(got, ' ', '')
|
||||
#gotStr = string.replace(gotStr, '\n', '')
|
||||
# gotStr = string.replace(gotStr, '\t', '')
|
||||
#expectedStr = string.replace(expected, ' ', '')
|
||||
#expectedStr = string.replace(expectedStr, '\n', '')
|
||||
#expectedStr = string.replace(expectedStr, '\t', '')
|
||||
if not got == expected:
|
||||
print "\n\n////////////////////////////////////////////////////////////////////////"
|
||||
expectedFileName = "expected.txt"
|
||||
gotFileName = "got.txt"
|
||||
print "Output is also saved to files '" + expectedFileName + \
|
||||
"' and '" + gotFileName + "'";
|
||||
|
||||
expectedFile = open(expectedFileName, "w")
|
||||
expectedFile.write(expected)
|
||||
expectedFile.close()
|
||||
gotFile = open(gotFileName, "w")
|
||||
gotFile.write(got)
|
||||
gotFile.close()
|
||||
raise RuntimeError("Expected: [" + str(expected) + "]\n" + "Got : [" + str(got) + "]\n")
|
||||
Loading…
Add table
Add a link
Reference in a new issue