Lines
100 %
Functions
Branches
//! Acceptance rows tagged phase 3 in `doc/ops/0010-common-lisp-booleans.org`:
//! `t` identity through a `$pair` car, arm reconciliation beside a count, and
//! the compile errors a nil seed/argument raises against a `Never` type.
use super::*;
#[tokio::test]
async fn list_of_t_and_nil_renders_both_spellings() {
assert_values(&[("(list t nil)", "(t nil)")]).await;
}
async fn eq_recognises_t_and_nil_by_identity_through_a_pair_car() {
assert_values(&[
("(eq? t (car (list t)))", "t"),
("(eq? nil (car (list nil)))", "t"),
("(null? (car (list nil t)))", "t"),
])
.await;
async fn a_missing_else_beside_a_count_is_nil_and_the_count_when_true() {
(
"(if (> (rpc-protocol-version) 5) (rpc-protocol-version))",
"nil",
),
"(if (> (rpc-protocol-version) 0) (rpc-protocol-version))",
"1",
async fn unless_with_a_false_test_runs_its_body() {
assert_values(&[("(unless (> (rpc-protocol-version) 5) 1)", "1")]).await;
async fn nil_into_a_never_type_is_a_compile_error() {
let response = eval_value_of("(let ((f (lambda (n) (+ n 1)))) (funcall f nil))").await;
assert!(
response.contains(":code compile") && response.contains("nil is not a scalar"),
"got: {response}"
);