reproduce failing `directory_exists/1` with working directory passed as first argument reproduce failing `delete_directory/1` with ./test directory passed as first argument reproduce failing `file_size/1` with 2 bytes files passed as first argument reproduce failing `file_exists/1` with existing file passed as first argument reproduce failing `file_modification_time/1`, `file_access_time/1` and `file_creation_time/1` with existing file passed as first argument reproduce failing `directory_files/2` with existing directory passed as first argument reproduce failing `delete_file/1` with existing file passed as first argument reproduce failing `make_directory/1` with non-existing directory passed as first argument reproduce failing `make_directory_path/1` with non-existing path passed as first argument reproduce failing `path_canonical/2` with non-canonical path passed as first argument reproduce failing `rename_file/2` with existing file passed as first argument, target file as second arg revised `directory_exists/1` test case renamed test files, test directories use `path_segments/2`, remove path separators do not write file size to current output revised `directory_files/2` test revised `path_canonical/2` test revised `file_exists/1` test removed hardcoded expected size extracted hardcoded directory argument remove path prefix containing path separator revised expected ls cmd exit code so that it is platform-agnostic Signed-off-by: Thierry Marianne <thierry@marianne.io>
150 lines
4.5 KiB
Rust
150 lines
4.5 KiB
Rust
use crate::helper::load_module_test;
|
|
#[cfg(not(target_arch = "wasm32"))]
|
|
use crate::helper::load_module_test_with_tokio_runtime;
|
|
use serial_test::serial;
|
|
|
|
// issue #831
|
|
#[serial]
|
|
#[test]
|
|
#[cfg_attr(miri, ignore = "it takes too long to run")]
|
|
fn call_0() {
|
|
load_module_test(
|
|
"tests-pl/issue831-call0.pl",
|
|
" error(existence_error(procedure,call/0),call/0).\n",
|
|
);
|
|
}
|
|
|
|
#[test]
|
|
#[cfg_attr(miri, ignore = "unsupported operation when isolation is enabled")]
|
|
fn issue2588_load_html() {
|
|
load_module_test("tests-pl/issue2588.pl", "[element(html,[],[element(head,[],[element(title,[],[[H,e,l,l,o,!]])]),element(body,[],[])])]");
|
|
}
|
|
|
|
#[test]
|
|
#[cfg_attr(miri, ignore = "unsupported operation when isolation is enabled")]
|
|
fn issue2949_load_html() {
|
|
load_module_test("tests-pl/issue2949.pl", "[doctype([h,t,m,l]),element(html,[],[element(head,[],[element(title,[],[[H,e,l,l,o,!]])]),element(body,[],[])])][doctype([h,t,m,l]),element(html,[],[element(head,[],[element(title,[],[[H,e,l,l,o,!]]),comment([ ,c,o,m,m,e,n,t, ])]),element(body,[],[])])][comment([]),element(html,[],[element(head,[],[]),element(body,[],[])])]");
|
|
}
|
|
|
|
// issue #2361
|
|
#[serial]
|
|
#[test]
|
|
#[cfg_attr(miri, ignore = "it takes too long to run")]
|
|
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", "");
|
|
}
|
|
|
|
// Issue #2725: A dcg of the form `id(X) --> X.` would previously trigger an instantiation
|
|
// error, as it would call `strip_module(X, M, P)` and later `call(M:P)`,
|
|
// but `strip_module` left `M` uninstanciated if the `module:` prefix was unspecified.
|
|
#[serial]
|
|
#[test]
|
|
#[cfg_attr(miri, ignore = "it takes too long to run")]
|
|
fn issue2725_dcg_without_module() {
|
|
load_module_test("tests-pl/issue2725.pl", "");
|
|
}
|
|
|
|
#[serial]
|
|
#[test]
|
|
#[cfg_attr(miri, ignore = "it takes too long to run")]
|
|
fn issue_delete_directory() {
|
|
load_module_test("tests-pl/issue_delete_directory.pl", "directory_deleted");
|
|
}
|
|
|
|
#[serial]
|
|
#[test]
|
|
#[cfg_attr(miri, ignore = "it takes too long to run")]
|
|
fn issue_delete_file() {
|
|
load_module_test("tests-pl/issue_delete_file.pl", "file_deleted");
|
|
}
|
|
|
|
#[serial]
|
|
#[test]
|
|
#[cfg_attr(miri, ignore = "it takes too long to run")]
|
|
fn issue_directory_exists() {
|
|
load_module_test("tests-pl/issue_directory_exists.pl", "");
|
|
}
|
|
|
|
#[serial]
|
|
#[test]
|
|
#[cfg_attr(miri, ignore = "it takes too long to run")]
|
|
fn issue_directory_files() {
|
|
load_module_test("tests-pl/issue_directory_files.pl", "1");
|
|
}
|
|
|
|
#[serial]
|
|
#[test]
|
|
#[cfg_attr(miri, ignore = "it takes too long to run")]
|
|
fn issue_file_copy() {
|
|
load_module_test("tests-pl/issue_file_copy.pl", "file_copied");
|
|
}
|
|
|
|
#[serial]
|
|
#[test]
|
|
#[cfg_attr(miri, ignore = "it takes too long to run")]
|
|
fn issue_file_exists() {
|
|
load_module_test("tests-pl/issue_file_exists.pl", "");
|
|
}
|
|
|
|
#[serial]
|
|
#[test]
|
|
#[cfg_attr(miri, ignore = "it takes too long to run")]
|
|
fn issue_file_size() {
|
|
load_module_test("tests-pl/issue_file_size.pl", "");
|
|
}
|
|
|
|
#[serial]
|
|
#[test]
|
|
#[cfg_attr(miri, ignore = "it takes too long to run")]
|
|
fn issue_file_time() {
|
|
load_module_test("tests-pl/issue_file_time.pl", "");
|
|
}
|
|
|
|
#[serial]
|
|
#[test]
|
|
#[cfg_attr(miri, ignore = "it takes too long to run")]
|
|
fn issue_make_directory() {
|
|
load_module_test("tests-pl/issue_make_directory.pl", "directory_made");
|
|
}
|
|
|
|
#[serial]
|
|
#[test]
|
|
#[cfg_attr(miri, ignore = "it takes too long to run")]
|
|
fn issue_make_directory_path() {
|
|
load_module_test("tests-pl/issue_make_directory_path.pl", "directory_path_made");
|
|
}
|
|
|
|
#[serial]
|
|
#[test]
|
|
#[cfg_attr(miri, ignore = "it takes too long to run")]
|
|
fn issue_path_canonical() {
|
|
load_module_test("tests-pl/issue_path_canonical.pl", "path_canonicalized");
|
|
}
|
|
|
|
#[serial]
|
|
#[test]
|
|
#[cfg_attr(miri, ignore = "it takes too long to run")]
|
|
fn issue_rename_file() {
|
|
load_module_test("tests-pl/issue_rename_file.pl", "file_renamed");
|
|
}
|
|
|
|
#[test]
|
|
#[cfg(feature = "http")]
|
|
#[cfg(not(target_arch = "wasm32"))]
|
|
#[cfg_attr(miri, ignore = "it takes too long to run")]
|
|
#[cfg_attr(not(miri), ignore = "flaky due to network requests")]
|
|
fn http_open_hanging() {
|
|
load_module_test_with_tokio_runtime(
|
|
"tests-pl/issue-http_open-hanging.pl",
|
|
"received response with status code:200\nreceived response with status code:200\nreceived response with status code:200\nreceived response with status code:200\nreceived response with status code:200\n"
|
|
);
|
|
}
|