def test_Compile_user_define(): """Test that Compile accepts a program with a custom #define.""" assert cxx.Compile(""" #define FLOAT_T float int A(FLOAT_T* a) {} """) == """
def test_Compile_syntax_error(): """Test that Compile rejects a program with invalid syntax.""" with pytest.raises(errors.ClangException) as e_info: cxx.Compile("int mainA2@@1!!!#") assert 'error: ' in str(e_info.value)
def test_Compile_empty_input(): """Test that Compile accepts an empty input.""" assert cxx.Compile('') == ''