PageRenderTime 29ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Examples/test-suite/chicken/li_std_string_runme_proxy.ss

#
Scheme | 47 lines | 30 code | 10 blank | 7 comment | 0 complexity | 70f73b4d51dc7b606e070ff6b9542a84 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. (load "li_std_string.so")
  2. (define x "hello")
  3. (if (not (string=? (test-value x) x))
  4. (begin (error "Error 1") (exit 1)))
  5. (if (not (string=? (test-const-reference x) x))
  6. (begin (error "Error 2") (exit 1)))
  7. (define y (test-pointer-out))
  8. (test-pointer y)
  9. (define z (test-const-pointer-out))
  10. (test-const-pointer z)
  11. (define a (test-reference-out))
  12. (test-reference a)
  13. ;; test global variables
  14. (GlobalString "whee")
  15. (if (not (string=? (GlobalString) "whee"))
  16. (error "Error 3"))
  17. (if (not (string=? (GlobalString2) "global string 2"))
  18. (error "Error 4"))
  19. (define struct (make <Structure>))
  20. ;; MemberString should be a wrapped class
  21. (if (not (string=? (slot-ref struct 'MemberString) ""))
  22. (error "Error 4.5"))
  23. ;(slot-set! (slot-ref struct 'MemberString) "and how")
  24. ;;(if (not (string=? (slot-ref struct 'MemberString) "and how"))
  25. ;; (error "Error 5"))
  26. (if (not (string=? (slot-ref struct 'MemberString2) "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)