示例#1
0
def test_should_compile():
    "Make sure that modules should be (re)compiled or not."
    filename = Path('tests/pkg4/mod4.nim')

    assert not Nimporter.is_hashed(filename)
    assert Nimporter.hash_changed(filename)
    assert not Nimporter.is_built(filename)
    assert not Nimporter.is_cache(filename)
    assert not NimCompiler.pycache_dir(filename).exists()
    assert not Nimporter.IGNORE_CACHE
    assert Nimporter.should_compile(filename)
示例#2
0
def test_hash_coincides():
    "Make sure an imported Nim module's hash matches the actual source file."
    from pkg1 import mod1
    assert not Nimporter.hash_changed(Path('tests/pkg1/mod1.nim'))