File: qa-utf8-char-regex

package info (click to toggle)
newlisp 10.7.5-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,292 kB
  • sloc: ansic: 33,280; lisp: 4,181; sh: 609; makefile: 215
file content (36 lines) | stat: -rwxr-xr-x 743 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
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env newlisp

(define (utf8-char-tests) 
  (and
    (= (char "킘") 0xd098)
    (= "킘" (char 0xd098))
    (= (char "퀿") 0xd03f)
    (= "퀿" (char 0xd03f))
    (= (char "Ω") 937)
    (= "Ω" (char 937))
    (= (char "Φ") 934)
    (= "Φ" (char 934))
))

(define (utf8-regex-tests)
  (and
    (= (regex "킘" "킘") '("킘" 0 3))
    (= (regex "퀿" "퀿") '("퀿" 0 3))
    (= (regex "Ω" "ΦabcΩdef") '("Ω" 5 2))
    (= (regex "Φ" "ΩabcΦdef") '("Φ" 5 2))
))

(if (utf8-char-tests)
    (println ">>>>> utf8-char-tests SUCESSFUL")
    (println ">>>>> ERROR in utf8-char-tests")
    )


(if (utf8-regex-tests)
    (println ">>>>> utf8-regex-tests SUCESSFUL")
    (println ">>>>> ERROR in utf8-regex-tests")
    )


(exit)