Exemple #1
0
 def testJavaMultiLineCommentsFileCount(self):
     f = open('../asantoro/multilinecomments.java')
     javaFile = f.read()
     testaroo = CountLines()
     lineCount = testaroo.numberOfLines(javaFile)
     assert lineCount == 4
     pass
Exemple #2
0
 def testJavaThreeLinesAndCommentFileCount(self):
     f = open('../asantoro/threelinesandcomment.java')
     javaFile = f.read()
     testaroo = CountLines()
     lineCount = testaroo.numberOfLines(javaFile)
     assert lineCount == 3
     pass
Exemple #3
0
 def testJavaEmptyBracesFileCount(self):
     f = open('../asantoro/emptybraces.java')
     javaFile = f.read()
     testaroo = CountLines()
     lineCount = testaroo.numberOfLines(javaFile)
     assert lineCount == 4
     pass
Exemple #4
0
 def testJavaHasBlankSpaceFileCount(self):
     f = open('../asantoro/hasblankspace.java')
     javaFile = f.read()
     testaroo = CountLines()
     lineCount = testaroo.numberOfLines(javaFile)
     assert lineCount == 3
     pass
Exemple #5
0
 def testJavaFileForLineCount(self):
     f = open('../asantoro/fourlinefile.java')
     javaFile = f.read()
     testaroo = CountLines()
     lineCount = testaroo.numberOfLines(javaFile)
     assert lineCount == 4
     pass
Exemple #6
0
 def testStripOutEmptyLines(self):
     testaroo = CountLines()
     newString = testaroo.stripOutBlankLines('test\r  \t  \na')
     assert newString == 'test\na'
     pass
Exemple #7
0
 def testEndLineComments(self):
     testaroo = CountLines()
     newString = testaroo.stripOutLineComments('This is a //test of the JavaScript RegExp object')
     assert newString == 'This is a '
     pass
Exemple #8
0
 def testMultipleNestedMultiLine(self):
     testaroo = CountLines()
     newString = testaroo.strippedMultiLineComments('This is a /*t\ne/*s*/\n/*t*/\n*/ of the Java/*Script*/ RegExp object')
     assert newString == 'This is a \n of the Java RegExp object'
     pass
Exemple #9
0
 def testNestedSingleLine(self):
     testaroo = CountLines()
     newString = testaroo.strippedMultiLineComments('Test a st/*hi*/ri/*blah*/ng lik/*blahblah*/e this')
     assert newString == 'Test a string like this'
     pass