Exemplo n.º 1
0
 def testJavaMultiLineCommentsFileCount(self):
     f = open('../asantoro/multilinecomments.java')
     javaFile = f.read()
     testaroo = CountLines()
     lineCount = testaroo.numberOfLines(javaFile)
     assert lineCount == 4
     pass
Exemplo n.º 2
0
 def testJavaThreeLinesAndCommentFileCount(self):
     f = open('../asantoro/threelinesandcomment.java')
     javaFile = f.read()
     testaroo = CountLines()
     lineCount = testaroo.numberOfLines(javaFile)
     assert lineCount == 3
     pass
Exemplo n.º 3
0
 def testJavaEmptyBracesFileCount(self):
     f = open('../asantoro/emptybraces.java')
     javaFile = f.read()
     testaroo = CountLines()
     lineCount = testaroo.numberOfLines(javaFile)
     assert lineCount == 4
     pass
Exemplo n.º 4
0
 def testJavaHasBlankSpaceFileCount(self):
     f = open('../asantoro/hasblankspace.java')
     javaFile = f.read()
     testaroo = CountLines()
     lineCount = testaroo.numberOfLines(javaFile)
     assert lineCount == 3
     pass
Exemplo n.º 5
0
 def testJavaFileForLineCount(self):
     f = open('../asantoro/fourlinefile.java')
     javaFile = f.read()
     testaroo = CountLines()
     lineCount = testaroo.numberOfLines(javaFile)
     assert lineCount == 4
     pass
Exemplo n.º 6
0
 def testStripOutEmptyLines(self):
     testaroo = CountLines()
     newString = testaroo.stripOutBlankLines('test\r  \t  \na')
     assert newString == 'test\na'
     pass
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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