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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)