PageRenderTime 16ms CodeModel.GetById 1ms app.highlight 9ms RepoModel.GetById 1ms app.codeStats 1ms

/trunk/Examples/test-suite/schemerunme/li_std_string.scm

#
Lisp | 46 lines | 33 code | 9 blank | 4 comment | 0 complexity | 02783211ab8048b549099e6ff615fbe8 MD5 | raw file
 1(define x "hello")
 2
 3(if (not (string=? (test-value x) x))
 4  (begin (error "Error 1") (exit 1)))
 5
 6(if (not (string=? (test-const-reference x) x))
 7  (begin (error "Error 2") (exit 1)))
 8
 9(define y (test-pointer-out))
10(test-pointer y)
11(define z (test-const-pointer-out))
12(test-const-pointer z)
13
14(define a (test-reference-out))
15(test-reference a)
16
17;; test global variables
18(GlobalString "whee")
19(if (not (string=? (GlobalString) "whee"))
20  (error "Error 3"))
21(if (not (string=? (GlobalString2) "global string 2"))
22  (error "Error 4"))
23
24(define struct (new-Structure))
25
26;; MemberString should be a wrapped class
27(define scl (Structure-MemberString-get struct))
28(if (not (string=? scl ""))
29  (error "Error 4.5"))
30(Structure-MemberString-set struct "and how")
31(if (not (string=? (Structure-MemberString-get struct) "and how"))
32  (error "Error 5"))
33(if (not (string=? (Structure-MemberString2-get struct) "member string 2"))
34  (error "Error 6"))
35(Structure-StaticMemberString "static str")
36(if (not (string=? (Structure-StaticMemberString) "static str"))
37  (error "Error 7"))
38(if (not (string=? (Structure-StaticMemberString2) "static member string 2"))
39  (error "Error 8"))
40
41;(if (not (string=? (Structure-ConstMemberString-get struct) "const member string"))
42;  (error "Error 9"))
43(if (not (string=? (Structure-ConstStaticMemberString) "const static member string"))
44  (error "Error 10"))
45
46(exit 0)