コード例 #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)