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: a self-recursive function whose base exit is a `(list …)` of
//! a parameter returns a list.
#[path = "persist/rows.rs"]
mod persist;
use persist::{Row, assert_pinned, row};
fn rows() -> Vec<Row> {
vec![
row(
"P3a",
&[
"(defun f (p n) (if (= n 0) (list n) (cons n (f p (- n 1)))))",
"(f 0 (+ (entity-count) 3))",
],
),
"P3b",
"(defun f (p n) (if (= n 0) (list p n) (cons n (f p (- n 1)))))",
"(f 7 (+ (entity-count) 2))",
]
}
const CL: &[(&str, &[&str])] = &[("P3a", &["f", "(3 2 1 0)"]), ("P3b", &["f", "(2 1 7 0)"])];
#[test]
fn every_row_reads_as_common_lisp() {
assert_pinned(&rows(), CL);