import os
import KernelCollection
def check(kernel_cache):
kernel_cache.buildKernelCollection("arm64", "/kext-bind-to-kpi-private-symbol-set-error/main.kc", "/kext-bind-to-kpi-private-symbol-set-error/main.kernel", "/kext-bind-to-kpi-private-symbol-set-error/extensions", ["com.apple.foo", "not.com.apple.bar"], ["-json-errors"])
assert len(kernel_cache.dictionary()) == 1
assert kernel_cache.dictionary()[0]["id"] == "not.com.apple.bar"
assert len(kernel_cache.dictionary()[0]["errors"]) == 1
assert kernel_cache.dictionary()[0]["errors"][0] == "Failed to bind '_foo' in 'not.com.apple.bar' (at offset 0x0 in __DATA, __got) as could not find a kext which exports this symbol"