Example #1
0
 def test_incorrect_python_singleline_comments(self):
     PYTHON_test_not_comments = [
         "   <# this is not a comment", "'##nor is this",
         "!---###this is also not a comment", "-##- and this also isn't"
     ]
     for python_comment in PYTHON_test_not_comments:
         self.is_python_comment = parse.check_comment_line(python_comment)
         self.assertFalse(self.is_python_comment)
Example #2
0
 def test_incorrect_html_comments(self):
     HTML_test_not_comments = [
         "   <!this is not a comment", "<!nor is this",
         "!----this is also not a comment", "-- and this also isn't"
     ]
     for html_comment in HTML_test_not_comments:
         self.is_html_comment = parse.check_comment_line(html_comment)
         self.assertFalse(self.is_html_comment)
Example #3
0
 def test_correct_python_singleline_comments(self):
     PYTHON_test_comments = [
         "   #HAHAHAHA this is a comment", "### as is this",
         "#this is also a comment", "# <!-- and this also"
     ]
     for python_comment in PYTHON_test_comments:
         self.is_python_comment = parse.check_comment_line(python_comment)
         self.assertTrue(self.is_python_comment)
Example #4
0
 def test_incorrect_matlab_comments(self):
     MATLAB_test_not_comments = [
         " */ this is not a comment", "<--/*nor is this",
         ' /!*--###this is also not a comment', "/#*##- and this also isn't"
     ]
     for matlab_comment in MATLAB_test_not_comments:
         self.is_matlab_comment = parse.check_comment_line(matlab_comment)
         self.assertFalse(self.is_matlab_comment)
Example #5
0
 def test_correct_html_comments(self):
     HTML_test_comments = [
         "   <!--HAHAHAHA this is a comment", "<!-- as is this",
         "<!----this is also a comment", "<!-- and this also"
     ]
     for html_comment in HTML_test_comments:
         self.is_html_comment = parse.check_comment_line(html_comment)
         self.assertTrue(self.is_html_comment)
Example #6
0
 def test_correct_matlab_comments(self):
     MATLAB_test_comments = [
         '   % HAHAHAHA this is a comment', '%%*//as is this',
         " %**this is also a comment", '%*** <!-- and this also'
     ]
     for matlab_comment in MATLAB_test_comments:
         self.is_matlab_comment = parse.check_comment_line(matlab_comment)
         self.assertTrue(self.is_matlab_comment)
Example #7
0
 def test_incorrect_java_comments(self):
     JAVA_test_not_comments = [
         " / this is not a comment", "<--/#nor is this",
         ' /!---###this is also not a comment', "/#-##- and this also isn't"
     ]
     for java_comment in JAVA_test_not_comments:
         self.is_java_comment = parse.check_comment_line(java_comment)
         self.assertFalse(self.is_java_comment)
Example #8
0
 def test_correct_java_comments(self):
     JAVA_test_comments = [
         "   //HAHAHAHA this is a comment", '////as is this',
         " //d//this is also a comment", '// <!-- and this also'
     ]
     for java_comment in JAVA_test_comments:
         self.is_java_comment = parse.check_comment_line(java_comment)
         self.assertTrue(self.is_java_comment)
Example #9
0
 def test_correct_multiline_comments(self):
     MULTILINE_test_comments = [
         "   /* HAHAHAHA this is a comment", '/*//as is this',
         " /**this is also a comment", '/*** <!-- and this also'
     ]
     for multiline_comment in MULTILINE_test_comments:
         self.is_multiline_comment = parse.check_comment_line(
             multiline_comment)
         self.assertTrue(self.is_multiline_comment)
Example #10
0
 def test_correct_python_block_comments(self):
     PYTHON_BLOCK_test_comments = [
         "   '''HAHAHAHA this is a comment", '""" as is this',
         " ''''''this is also a comment", '""" <!-- and this also'
     ]
     for python_block_comment in PYTHON_BLOCK_test_comments:
         self.is_python_block_comment = parse.check_comment_line(
             python_block_comment)
         self.assertTrue(self.is_python_block_comment)
Example #11
0
 def test_incorrect_python_block_comments(self):
     PYTHON_BLOCK_test_not_comments = [
         " ''  <# this is not a comment", "''##nor is this",
         ' ""!---###this is also not a comment',
         "''-##- and this also isn't"
     ]
     for python_comment in PYTHON_BLOCK_test_not_comments:
         self.is_python_comment = parse.check_comment_line(python_comment)
         self.assertFalse(self.is_python_comment)
Example #12
0
 def test_incorrect_java_comments(self):
     JAVA_test_not_comments = [" / this is not a comment", "<--/#nor is this", ' /!---###this is also not a comment', "/#-##- and this also isn't"]
     for java_comment in JAVA_test_not_comments:
         self.is_java_comment = parse.check_comment_line(java_comment)
         self.assertFalse(self.is_java_comment)
Example #13
0
 def test_incorrect_python_block_comments(self):
     PYTHON_BLOCK_test_not_comments = [" ''  <# this is not a comment", "''##nor is this", ' ""!---###this is also not a comment', "''-##- and this also isn't"]
     for python_comment in PYTHON_BLOCK_test_not_comments:
         self.is_python_comment = parse.check_comment_line(python_comment)
         self.assertFalse(self.is_python_comment)
Example #14
0
 def test_correct_java_comments(self):
    	JAVA_test_comments = ["   //HAHAHAHA this is a comment", '////as is this', " //d//this is also a comment", '// <!-- and this also']
     for java_comment in JAVA_test_comments:
         self.is_java_comment = parse.check_comment_line(java_comment)
         self.assertTrue(self.is_java_comment)
Example #15
0
 def test_incorrect_python_singleline_comments(self):
     PYTHON_test_not_comments = ["   <# this is not a comment", "'##nor is this", "!---###this is also not a comment", "-##- and this also isn't"]
     for python_comment in PYTHON_test_not_comments:
         self.is_python_comment = parse.check_comment_line(python_comment)
         self.assertFalse(self.is_python_comment)
Example #16
0
 def test_correct_python_block_comments(self):
     PYTHON_BLOCK_test_comments = ["   '''HAHAHAHA this is a comment", '""" as is this', " '''this is also a comment", '""" <!-- and this also']
     for python_block_comment in PYTHON_BLOCK_test_comments:
         self.is_python_block_comment = parse.check_comment_line(python_block_comment)
         self.assertTrue(self.is_python_block_comment)
Example #17
0
 def test_correct_python_singleline_comments(self):
     PYTHON_test_comments = ["   #HAHAHAHA this is a comment", "### as is this", "#this is also a comment", "# <!-- and this also"]
     for python_comment in PYTHON_test_comments:
         self.is_python_comment = parse.check_comment_line(python_comment)
         self.assertTrue(self.is_python_comment)
Example #18
0
 def test_incorrect_html_comments(self):
     HTML_test_not_comments = ["   <!this is not a comment", "<!nor is this", "!----this is also not a comment", "-- and this also isn't"]
     for html_comment in HTML_test_not_comments:
         self.is_html_comment = parse.check_comment_line(html_comment)
         self.assertFalse(self.is_html_comment)
Example #19
0
 def test_correct_html_comments(self):
     HTML_test_comments = ["   <!--HAHAHAHA this is a comment", "<!-- as is this", "<!----this is also a comment", "<!-- and this also"]
     for html_comment in HTML_test_comments:
         self.is_html_comment = parse.check_comment_line(html_comment)
         self.assertTrue(self.is_html_comment)
Example #20
0
 def test_correct_matlab_comments(self):
     MATLAB_test_comments = ["%HAHAHAHA this is a comment", "%as is this", " %this is also a comment", '%and this also']
     for matlab_comment in MATLAB_test_comments:
         self.is_matlab_comment = parse.check_comment_line(matlab_comment)
         self.assertTrue(self.is_matlab_comment)
Example #21
0
 def test_correct_multiline_comments(self):
     MULTILINE_test_comments = ["   /* HAHAHAHA this is a comment", '/*//as is this', " /**this is also a comment", '/*** <!-- and this also']
     for multiline_comment in MULTILINE_test_comments:
         self.is_multiline_comment = parse.check_comment_line(multiline_comment)
         self.assertTrue(self.is_multiline_comment)
Example #22
0
 def test_incorrect_multiline_comments(self):
     MULTILINE_test_not_comments = [" */ this is not a comment", "<--/*nor is this", ' /!*--###this is also not a comment', "/#*##- and this also isn't"]
     for multiline_comment in MULTILINE_test_not_comments:
         self.is_multiline_comment = parse.check_comment_line(multiline_comment)
         self.assertFalse(self.is_multiline_comment)
Example #23
0
 def test_correct_matlab_comments(self):
     MATLAB_test_comments = ['   % HAHAHAHA this is a comment', '%%*//as is this', " %**this is also a comment", '%*** <!-- and this also']
     for matlab_comment in MATLAB_test_comments:
         self.is_matlab_comment = parse.check_comment_line(matlab_comment)
         self.assertTrue(self.is_matlab_comment)