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))]
//! PERSIST rows with their Common Lisp values: a macro name is a macro only
//! in operator position, in a carried closure and next to a variable.
#[path = "persist/rows.rs"]
mod persist;
use persist::{Row, assert_pinned, row};
const DBL: &str = "(defmacro dbl (x) `(* ,x 2))";
fn rows() -> Vec<Row> {
vec![
row(
"O1",
&[DBL, "(defvar *k* (lambda () '(dbl 1)))", "(funcall *k*)"],
),
"O2",
&[
DBL,
"(defvar *k* (lambda (y) (labels ((dbl (x) (+ x 1))) (dbl y))))",
"(funcall *k* 4)",
],
]
}
/// CL: O1 (dbl 1), O2 5.
const TODAY: &[(&str, &[&str])] = &[("O1", &["dbl", "-", "(dbl 1)"]), ("O2", &["dbl", "-", "5"])];
#[test]
fn every_row_reads_as_common_lisp() {
assert_pinned(&rows(), TODAY);