예제 #1
0
def test_no_space_before_comment():
    contents = '''
#endif//MATCH_H
'''
    s, e = go.index_guard_end(contents)
    assert_equals(s, 1)
    assert_equals(e, 16)
예제 #2
0
def test_ok_space_after_hash():
    contents = '''
# endif
'''
    s, e = go.index_guard_end(contents)
    assert_equals(s, 1)
    assert_equals(e, 8)
예제 #3
0
def test_ok():
    contents = '''
#endif
'''
    s, e = go.index_guard_end(contents)
    assert_equals(s, 1)
    assert_equals(e, 7)
예제 #4
0
def test_comment():
    contents = '''
#endif /* MATCH_H */
'''
    s, e = go.index_guard_end(contents)
    assert_equals(s, 1)
    assert_equals(e, 21)
예제 #5
0
def test_ok():
    contents = '''
#endif
'''
    s,e = go.index_guard_end(contents)
    assert_equals(s, 1)
    assert_equals(e, 7)
예제 #6
0
def test_no_space_before_comment():
    contents = '''
#endif//MATCH_H
'''
    s,e = go.index_guard_end(contents)
    assert_equals(s, 1)
    assert_equals(e, 16)
예제 #7
0
def test_comment():
    contents = '''
#endif /* MATCH_H */
'''
    s,e = go.index_guard_end(contents)
    assert_equals(s, 1)
    assert_equals(e, 21)
예제 #8
0
def test_ok_space_after_hash():
    contents = '''
# endif
'''
    s,e = go.index_guard_end(contents)
    assert_equals(s, 1)
    assert_equals(e, 8)
예제 #9
0
def test_matches_last_endif():
    contents = '''
#ifndef MATCH_H
#define MATCH_H
#ifdef WIN32
#error Psalm 24:4
#endif /* WIN32 */
#endif /* MATCH_H */
'''
    s, e = go.index_guard_end(contents)
    assert_equals(s, 83)
    assert_equals(e, 103)
예제 #10
0
def test_matches_last_endif():
    contents = '''
#ifndef MATCH_H
#define MATCH_H
#ifdef WIN32
#error Psalm 24:4
#endif /* WIN32 */
#endif /* MATCH_H */
'''
    s,e = go.index_guard_end(contents)
    assert_equals(s, 83)
    assert_equals(e, 103)
예제 #11
0
def test_no_endif():
    contents = '''
#endf
'''
    go.index_guard_end(contents)
예제 #12
0
def test_no_newline_at_eof():
    contents = '''
#endif'''
    s, e = go.index_guard_end(contents)
    assert_equals(s, 1)
    assert_equals(e, 7)
예제 #13
0
def test_no_endif():
    contents = '''
#endf
'''
    go.index_guard_end(contents)
예제 #14
0
def test_no_newline_at_eof():
    contents = '''
#endif'''
    s,e = go.index_guard_end(contents)
    assert_equals(s, 1)
    assert_equals(e, 7)