File: xmlengthtest.lsp

package info (click to toggle)
nyquist 3.23%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 58,064 kB
  • sloc: ansic: 74,758; lisp: 18,104; java: 10,719; cpp: 6,688; sh: 171; xml: 58; makefile: 40; python: 15
file content (22 lines) | stat: -rw-r--r-- 652 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
;; xmlengthtest.lsp - make-length (length pattern generator) test
;; 
;; Roger B. Dannenberg
;; Feb, 2018

;; length test

(setf lenp (make-length (make-cycle '(a b c d)) 5))
(setf lenpp (next lenp t))
(xmassert (equal '(a b c d a) lenpp) "lenpp")
(setf lenpp (next lenp t))
(xmassert (equal '(b c d a b) lenpp) "lenpp2")

;; use length-pattern
(setf lenfp (make-length (make-cycle '(a b c d)) (make-cycle '(5 6))))
(setf lenfpp (next lenfp t))
(xmassert (equal '(a b c d a) lenfpp) "lenfpp")
(setf lenfpp (next lenfp t))
(xmassert (equal '(b c d a b c) lenfpp) "lenfpp2")
(setf lenfpp (next lenfp t))
(xmassert (equal '(d a b c d) lenfpp) "lenfpp3")