Lines
100 %
Functions
Branches
//! `PP` and `APROPOS` builtins (DESCRIBE tests live in
//! `compile_eval_form.rs`). PP returns the formatted-text form of
//! its arg; APROPOS returns a quoted list of registry names matching
//! a substring.
use super::common::{compile_and_validate, compile_expect_error};
#[test]
fn pp_of_constant_number() {
compile_and_validate("(pp 42)");
}
fn pp_of_string() {
compile_and_validate("(pp \"hello\")");
fn pp_of_list() {
compile_and_validate("(pp '(1 2 3))");
fn pp_of_bool() {
compile_and_validate("(pp #t)");
fn pp_of_nil() {
compile_and_validate("(pp nil)");
fn pp_wrong_arity_errors() {
let err = compile_expect_error("(pp)");
assert!(err.contains("PP"), "got: {err}");
fn pp_too_many_args_errors() {
let err = compile_expect_error("(pp 1 2)");
fn apropos_with_string_substring() {
compile_and_validate("(apropos \"entity\")");
fn apropos_with_symbol_substring() {
compile_and_validate("(apropos transaction)");
fn apropos_with_quoted_string() {
compile_and_validate("(apropos 'list)");
fn apropos_empty_match_is_empty_list() {
compile_and_validate("(apropos \"no-such-thing-anywhere\")");
fn apropos_wrong_arity_errors() {
let err = compile_expect_error("(apropos)");
assert!(err.contains("APROPOS"), "got: {err}");
fn apropos_non_string_errors() {
let err = compile_expect_error("(apropos 42)");