Пример #1
0
def test_StripComments_small_program():
    """Test Strip Comments on a small program."""
    assert cxx.StripComments("""
/* comment header */

int main(int argc, char** argv) { // main function.
  return /* foo */ 0;
}
""") == """
Пример #2
0
def test_StripComments_only_comment():
    """Test StripComments on an input containing only comments."""
    assert cxx.StripComments("// Just a comment") == " "
    assert cxx.StripComments("/* Just a comment */") == " "
Пример #3
0
def test_StripComments_empty_input():
    """Test StripComments on an empty input."""
    assert cxx.StripComments("") == ""
Пример #4
0
def test_StripComments_only_comment():
    """Test StripComments on an input containing only comments."""
    assert cxx.StripComments('// Just a comment') == ' '
    assert cxx.StripComments('/* Just a comment */') == ' '