PageRenderTime 46ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

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

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