1
// Skipped under Miri: these tests compile+run wasm via wasmtime, whose
2
// Cranelift backend refuses to run under Miri.
3
#![cfg(not(miri))]
4

            
5
//! PERSIST rows with their Common Lisp values: a DEFUN over a macro replaces
6
//! it, and a DEFMACRO over a function does too.
7

            
8
#[path = "persist/rows.rs"]
9
mod persist;
10

            
11
use persist::{Row, assert_pinned, row};
12

            
13
const MACRO: &str = "(defmacro m (x) `(* ,x 2))";
14
const FUNCTION: &str = "(defun m (x) (list x x))";
15

            
16
1
fn rows() -> Vec<Row> {
17
1
    vec![
18
1
        row("R1", &[MACRO, FUNCTION, "(m (+ 1 2))"]),
19
1
        row("R2", &[FUNCTION, MACRO, "(m (+ 1 2))"]),
20
    ]
21
1
}
22

            
23
/// CL: R1 (3 3), R2 6.
24
const TODAY: &[(&str, &[&str])] = &[("R1", &["m", "m", "(3 3)"]), ("R2", &["m", "m", "6"])];
25

            
26
#[test]
27
1
fn every_row_reads_as_common_lisp() {
28
1
    assert_pinned(&rows(), TODAY);
29
1
}