import os
import KernelCollection
def check(kernel_cache):
kernel_cache.buildKernelCollection("arm64", "/kexts-missing-split-seg-error/main.kc", "/kexts-missing-split-seg-error/main.kernel", "/kexts-missing-split-seg-error/extensions", ["com.apple.foo", "com.apple.bar"], ["-json-errors"])
assert len(kernel_cache.dictionary()) == 2
assert kernel_cache.dictionary()[0]["id"] == "com.apple.bar"
assert len(kernel_cache.dictionary()[0]["errors"]) == 1
assert kernel_cache.dictionary()[0]["errors"][0] == "cannot be placed in kernel collection because: Missing split seg v2"
assert kernel_cache.dictionary()[1]["id"] == "com.apple.foo"
assert len(kernel_cache.dictionary()[1]["errors"]) == 1
assert kernel_cache.dictionary()[1]["errors"][0] == "cannot be placed in kernel collection because: Missing split seg v2"