source: project/release/4/readline/trunk/tests/run.scm @ 34923

Last change on this file since 34923 was 34923, checked in by Alexej Magura, 3 years ago

releasing version 4.1.3: heres to a build that hopefully isnt broken

  • Property svn:mime-type set to application/zlib
File size: 1.0 KB
Line 
1(require-extension test readline srfi-1)
2
3(define (kvlist? x)
4  (and (proper-list? x)
5       (= (modulo (length x) 2) 0)
6       (every (lambda (kv) (keyword? (car kv)))
7              (chop x 2))))
8
9(test-begin "Readline variables")
10(test-assert "readline#session is a kvlist"
11             (kvlist? readline#session))
12(test-end)
13(test-begin "Readline functions")
14(readline#%add-history% "foobar")
15
16(test-assert "history is consistent between calls"
17             (string=? (last (readline#history-list)) "foobar"))
18
19(test-assert "readline#history-position returns an integer"
20             (integer? (readline#history-position)))
21
22(test "readline#history-position's setter works"
23      1
24      (and (set! (readline#history-position) 1)
25           (readline#history-position)))
26
27(readline#%add-history% "(print 1)")
28
29(test "readline#eval-last-history-line works"
30      (void)
31      (readline#eval-last-history-line #t))
32
33
34(test "readline#last-history-line is the last added line"
35      "(print 1)"
36      (readline#last-history-line #t #t))
37(test-end)
38(test-exit)
Note: See TracBrowser for help on using the repository browser.