def test_source_directory(fs):
    os.makedirs('project/')
    os.chdir('project/')
    os.makedirs('include/')
    os.makedirs('src/')
    with open('include/main.hpp', 'w+') as file:
        file.write(FILE_MAIN_HPP)
    with open('src/main.cpp', 'w+') as file:
        file.write(FILE_MAIN_CPP)
    dst = StringIO()
    Quom(Path('include/main.hpp'), dst)
    assert (dst.getvalue() != RESULT)
    dst = StringIO()
    Quom(Path('include/main.hpp'), dst, relative_source_directories=[Path('../src')])
    assert (dst.getvalue() == RESULT)
    dst = StringIO()
    Quom(Path('include/main.hpp'), dst, source_directories=[Path('src').resolve()])
    assert (dst.getvalue() == RESULT)
    dst = StringIO()
    Quom(Path('include/main.hpp'), dst, source_directories=[Path('/project/src')])
    assert (dst.getvalue() == RESULT)
    main(['include/main.hpp', 'result.hpp', '-S', './../src'])
    assert (Path('result.hpp').read_text() == RESULT)
    main(['include/main.hpp', 'result.hpp', '-S', 'src'])
    assert (Path('result.hpp').read_text() == RESULT)
    main(['include/main.hpp', 'result.hpp', '-S', '/project/src'])
    assert (Path('result.hpp').read_text() == RESULT)
def test_source_directory(fs):
    os.makedirs('project/')
    os.chdir('project/')
    os.makedirs('include/')
    os.makedirs('src/')
    with open('include/main.hpp', 'w+') as file:
        file.write(FILE_MAIN_HPP)
    with open('src/main.cpp', 'w+') as file:
        file.write(FILE_MAIN_CPP)
    dst = StringIO()
    Quom(Path('include/main.hpp'), dst)
    assert (dst.getvalue() != RESULT)
    dst = StringIO()
    Quom(Path('include/main.hpp'), dst, relative_source_directories=[Path('../src')])
    assert (dst.getvalue() == RESULT)
    dst = StringIO()
    Quom(Path('include/main.hpp'), dst, source_directories=[Path('src').resolve()])
    assert (dst.getvalue() == RESULT)
    dst = StringIO()
    Quom(Path('include/main.hpp'), dst, source_directories=[Path('/project/src')])
    assert (dst.getvalue() == RESULT)
    main(['include/main.hpp', 'result.hpp', '-S', './../src'])
    assert (Path('result.hpp').read_text() == RESULT)
    main(['include/main.hpp', 'result.hpp', '-S', 'src'])
    assert (Path('result.hpp').read_text() == RESULT)
    main(['include/main.hpp', 'result.hpp', '-S', '/project/src'])
    assert (Path('result.hpp').read_text() == RESULT)