import os
import KernelCollection
def check(kernel_cache):
kernel_cache.buildKernelCollection("arm64", "/rwx-permissions-error/main.kc", "/rwx-permissions-error/main.kernel", "", [], ["-json-errors"])
assert len(kernel_cache.dictionary()) == 1
assert kernel_cache.dictionary()[0]["id"] == "com.apple.kernel"
assert len(kernel_cache.dictionary()[0]["errors"]) == 1
assert kernel_cache.dictionary()[0]["errors"][0] == "cannot be placed in kernel collection because: Segments are not allowed to be both writable and executable"