From eff094cc2906f830b1a8c306d5fc9aa34b893bbc Mon Sep 17 00:00:00 2001 From: Emilie Burgun Date: Tue, 7 Jan 2025 18:10:50 +0100 Subject: [PATCH] Add tests for PR #2756 --- tests-pl/load-context-unreachable.pl | 1 + tests/scryer/issues.rs | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 tests-pl/load-context-unreachable.pl diff --git a/tests-pl/load-context-unreachable.pl b/tests-pl/load-context-unreachable.pl new file mode 100644 index 00000000..5a0f2782 --- /dev/null +++ b/tests-pl/load-context-unreachable.pl @@ -0,0 +1 @@ +:- initialization((M = user, loader:load_context(M))). diff --git a/tests/scryer/issues.rs b/tests/scryer/issues.rs index de318708..207c4909 100644 --- a/tests/scryer/issues.rs +++ b/tests/scryer/issues.rs @@ -25,3 +25,11 @@ fn issue2588_load_html() { fn call_qualification() { load_module_test("tests-pl/issue2361-call-qualified.pl", ""); } + +// PR #2756: ensures that calling load_context with a bound variable doesn't trigger unreachable!() +#[serial] +#[test] +#[cfg_attr(miri, ignore = "it takes too long to run")] +fn load_context_unreachable() { + load_module_test("tests-pl/load-context-unreachable.pl", ""); +} -- 2.54.0