Lines
100 %
Functions
Branches
// Skipped under Miri: these tests compile+run wasm via wasmtime, whose
// Cranelift backend refuses to run under Miri.
#![cfg(not(miri))]
//! A bare name of a Common Lisp function used as a value is an unbound
//! variable, never "special form" or "macro" (plan L2-3c). SBCL: unbound
//! variable in every row; IF and WHEN keep their own texts.
#[path = "persist/rows.rs"]
mod persist;
use persist::{Row, assert_pinned, assert_pinned_wide, row};
fn rows() -> Vec<Row> {
vec![
row("C1", &["(list macroexpand)"]),
row("C2", &["(let ((x funcall)) x)"]),
row("C3", &["(print mapcar)"]),
row("C4", &["(list 1+)"]),
row("C5", &["(list apply)"]),
]
}
fn operator_rows() -> Vec<Row> {
vec![row("C6", &["(list if)"]), row("C7", &["(list when)"])]
const VALUES: &[(&str, &[&str])] = &[
(
"C1",
&["err: Compile error: variable MACROEXPAND is unbound; use 'macroexpand or #'macroexpand"],
),
"C2",
&["err: Compile error: variable FUNCALL is unbound; use 'funcall or #'funcall"],
"C3",
&["err: Compile error: MAPCAR cannot be used as a function value yet"],
"C4",
&["err: Compile error: 1+ cannot be used as a function value yet"],
"C5",
&["err: Compile error: variable APPLY is unbound; use 'apply or #'apply"],
];
#[test]
fn a_cl_function_name_as_a_value_is_unbound() {
assert_pinned_wide(&rows(), VALUES, 100);
const OPERATORS: &[(&str, &[&str])] = &[
("C6", &["err: Compile error: 'IF' is a special form and ca"]),
("C7", &["err: Compile error: 'WHEN' is a macro and cannot "]),
fn a_real_operator_as_a_value_keeps_its_text() {
assert_pinned(&operator_rows(), OPERATORS);