Skip to content

cond-expand

Given a file named “main.scm” with:

(import (scheme base))
(cond-expand
(else
(write-u8 65)))

When I successfully run stak main.scm

Then the stdout should contain exactly “A”.

Given a file named “main.scm” with:

(import (scheme base))
(cond-expand
(r7rs
(write-u8 65)))

When I successfully run stak main.scm

Then the stdout should contain exactly “A”.

Given a file named “main.scm” with:

(import (scheme base))
(cond-expand
(foo
(write-u8 65))
(else
(write-u8 66)))

When I successfully run stak main.scm

Then the stdout should contain exactly “B”.

Given a file named “main.scm” with:

(import (scheme base))
(cond-expand
((library (scheme base))
(write-u8 65)))

When I successfully run stak main.scm

Then the stdout should contain exactly “A”.

Given a file named “main.scm” with:

(import (scheme base))
(cond-expand
((library <library>)
(write-u8 65))
(else
(write-u8 66)))

When I successfully run stak main.scm

Then the stdout should contain exactly “A”.

library
(scheme char)
(scheme lazy)
library
(srfi 1)

Given a file named “main.scm” with:

(import (scheme base) (scheme read))
(cond-expand
((library (scheme read))
(write-u8 65))
(else
(write-u8 66)))

When I successfully run stak main.scm

Then the stdout should contain exactly “A”.

Given a file named “main.scm” with:

(define-library (foo)
(export foo)
(import (scheme base))
(begin
(define foo 65)))
(import (scheme base))
(cond-expand
((library (foo))
(write-u8 65))
(else
(write-u8 66)))

When I successfully run stak main.scm

Then the stdout should contain exactly “A”.

Given a file named “library/foo/bar.sld” with:

(define-library (foo bar)
(export bar)
(import (scheme base))
(begin
(define bar 65)))

And a file named “main.scm” with:

(import (scheme base))
(cond-expand
((library (foo bar))
(write-u8 65))
(else
(write-u8 66)))

When I successfully run stak -I library main.scm

Then the stdout should contain exactly “A”.

Given a file named “main.scm” with:

(import (scheme base))
(cond-expand
((library (scheme miracle))
(write-u8 65))
(else
(write-u8 66)))

When I successfully run stak main.scm

Then the stdout should contain exactly “B”.

Given a directory named “library”

And a file named “main.scm” with:

(import (scheme base))
(cond-expand
((library (foo bar))
(write-u8 65))
(else
(write-u8 66)))

When I successfully run stak -I library main.scm

Then the stdout should contain exactly “B”.

Given a file named “main.scm” with:

(import (scheme base))
(cond-expand
((library (scheme miracle))
(syntax-error "unexpected expansion"))
(else
(write-u8 65)))

When I successfully run stak main.scm

Then the stdout should contain exactly “A”.

Given a file named “main.scm” with:

(import (scheme base))
(cond-expand
((lib (scheme base))
(write-u8 65))
(else
(write-u8 66)))

When I run stak main.scm

Then the exit status should not be 0.

Given a file named “main.scm” with:

(import (scheme base))
(cond-expand (r7rs))

When I successfully run stak main.scm

Then the exit status should be 0.

Given a file named “main.scm” with:

(import (scheme base))
(cond-expand (else))

When I successfully run stak main.scm

Then the exit status should be 0.

Given a file named “main.scm” with:

(import (scheme base))
(cond-expand
((not foo)
(write-u8 65)))

When I successfully run stak main.scm

Then the stdout should contain exactly “A”.

Given a file named “main.scm” with:

(import (scheme base))
(cond-expand
((not (library (scheme miracle)))
(write-u8 65))
(else
(write-u8 66)))

When I successfully run stak main.scm

Then the stdout should contain exactly “A”.

Given a file named “main.scm” with:

(import (scheme base))
(write-u8 (if (memq 'r7rs (features)) 65 66))

When I successfully run stak main.scm

Then the stdout should contain exactly “A”.

Given a file named “main.scm” with:

(import (scheme base))
(cond-expand
((and)
(write-u8 65)))

When I successfully run stak main.scm

Then the stdout should contain exactly “A”.

Given a file named “main.scm” with:

(import (scheme base))
(cond-expand
((and r7rs)
(write-u8 65)))

When I successfully run stak main.scm

Then the stdout should contain exactly “A”.

Given a file named “main.scm” with:

(import (scheme base))
(cond-expand
((and r7rs r7rs)
(write-u8 65)))

When I successfully run stak main.scm

Then the stdout should contain exactly “A”.

Given a file named “main.scm” with:

(import (scheme base))
(cond-expand
((or)
(write-u8 65))
(else
(write-u8 66)))

When I successfully run stak main.scm

Then the stdout should contain exactly “B”.

Given a file named “main.scm” with:

(import (scheme base))
(cond-expand
((or r7rs)
(write-u8 65)))

When I successfully run stak main.scm

Then the stdout should contain exactly “A”.

Given a file named “main.scm” with:

(import (scheme base))
(cond-expand
((or foo r7rs)
(write-u8 65)))

When I successfully run stak main.scm

Then the stdout should contain exactly “A”.