Exemplo n.º 1
0
def test_if_defined_space_before_newline():
    contents = '''
#if !defined(MATCH_H) 
#define MATCH_H
'''
    s,e = go.index_guard_start(contents, 'MATCH_H')
    assert_equals(s, 1)
    assert_equals(e, 39)
Exemplo n.º 2
0
def test_ok_space_before_hash():
    contents = '''
 #ifndef MATCH_H
#define MATCH_H
'''
    s,e = go.index_guard_start(contents, 'MATCH_H')
    assert_equals(s, 1)
    assert_equals(e, 33)
Exemplo n.º 3
0
def test_ok():
    contents = '''
#ifndef MATCH_H
#define MATCH_H
'''
    s,e = go.index_guard_start(contents, 'MATCH_H')
    assert_equals(s, 1)
    assert_equals(e, 32)
Exemplo n.º 4
0
def test_define_with_value_1():
    contents = '''
#ifndef MATCH_H
#define MATCH_H 1
'''
    s,e = go.index_guard_start(contents, 'MATCH_H')
    assert_equals(s, 1)
    assert_equals(e, 34)
Exemplo n.º 5
0
def test_define_with_value_1():
    contents = '''
#ifndef MATCH_H
#define MATCH_H 1
'''
    s, e = go.index_guard_start(contents, 'MATCH_H')
    assert_equals(s, 1)
    assert_equals(e, 34)
Exemplo n.º 6
0
def test_ok_space_before_hash():
    contents = '''
 #ifndef MATCH_H
#define MATCH_H
'''
    s, e = go.index_guard_start(contents, 'MATCH_H')
    assert_equals(s, 1)
    assert_equals(e, 33)
Exemplo n.º 7
0
def test_extra_whitespace_on_define():
    contents = '''
#ifndef MATCH_H
#define MATCH_H 
'''
    s,e = go.index_guard_start(contents, 'MATCH_H')
    assert_equals(s, 1)
    assert_equals(e, 33)
Exemplo n.º 8
0
def test_extra_whitespace_on_define():
    contents = '''
#ifndef MATCH_H
#define MATCH_H 
'''
    s, e = go.index_guard_start(contents, 'MATCH_H')
    assert_equals(s, 1)
    assert_equals(e, 33)
Exemplo n.º 9
0
def test_ok():
    contents = '''
#ifndef MATCH_H
#define MATCH_H
'''
    s, e = go.index_guard_start(contents, 'MATCH_H')
    assert_equals(s, 1)
    assert_equals(e, 32)
Exemplo n.º 10
0
def test_if_defined_no_parentheses():
    contents = '''
#if !defined MATCH_H
#define MATCH_H
'''
    s,e = go.index_guard_start(contents, 'MATCH_H')
    assert_equals(s, 1)
    assert_equals(e, 37)
Exemplo n.º 11
0
def test_mismatched_define_symbol():
    contents = '''
#ifndef MATCH_H
#define MISMATCH_H
'''
    go.index_guard_start(contents, 'MATCH_H')
Exemplo n.º 12
0
def test_no_define():
    contents = '''
#ifndef MATCH_H
#defne MATCH_H
'''
    go.index_guard_start(contents, 'MATCH_H')
Exemplo n.º 13
0
def test_bad_symbol_substring():
    contents = '''
#ifndef MISMATCH_H
#define MISMATCH_H
'''
    go.index_guard_start(contents, 'STRING_H')
Exemplo n.º 14
0
def test_mismatched_define_symbol():
    contents = '''
#ifndef MATCH_H
#define MISMATCH_H
'''
    go.index_guard_start(contents, 'MATCH_H')
Exemplo n.º 15
0
def test_no_define():
    contents = '''
#ifndef MATCH_H
#defne MATCH_H
'''
    go.index_guard_start(contents, 'MATCH_H')
Exemplo n.º 16
0
def test_bad_symbol_substring():
    contents = '''
#ifndef MISMATCH_H
#define MISMATCH_H
'''
    go.index_guard_start(contents, 'STRING_H')
Exemplo n.º 17
0
def test_if_defined_extra_junk_in_defined():
    contents = '''
#if !defined(MATCH_H WEIRD_HUH)
#define MATCH_H
'''
    go.index_guard_start(contents, 'MATCH_H')
Exemplo n.º 18
0
def test_if_defined_extra_junk_before_newline():
    contents = '''
#if !defined(MATCH_H) WEIRD_HUH
#define MATCH_H
'''
    go.index_guard_start(contents, 'MATCH_H')
Exemplo n.º 19
0
def test_extra_junk_on_define():
    contents = '''
#ifndef MATCH_H
#define MATCH_H WEIRD_HUH
'''
    go.index_guard_start(contents, 'MATCH_H')
Exemplo n.º 20
0
def test_extra_junk_on_define():
    contents = '''
#ifndef MATCH_H
#define MATCH_H WEIRD_HUH
'''
    go.index_guard_start(contents, 'MATCH_H')