Changeset 35363 in project


Ignore:
Timestamp:
03/28/18 04:21:24 (6 months ago)
Author:
kon
Message:

use csi+csc test runner

Location:
release/4/locale/trunk
Files:
1 added
10 edited

Legend:

Unmodified
Added
Removed
  • release/4/locale/trunk/locale-builtin.scm

    r23540 r35363  
    88(module locale-builtin
    99
    10   (;export
    11     ;
    12     builtin-source-name builtin-source-name?
    13     unknown-timezone-name unknown-timezone-name?
    14     ;
    15     use-builtin-timezone
    16     use-builtin-locale
    17     use-builtin-language)
     10(;export
     11  ;
     12  builtin-source-name builtin-source-name?
     13  unknown-timezone-name unknown-timezone-name?
     14  ;
     15  use-builtin-timezone
     16  use-builtin-locale
     17  use-builtin-language)
    1818
    19   (import
    20     scheme chicken
    21     (only posix seconds->local-time local-timezone-abbreviation)
    22     locale-posix
    23     locale-components
    24     locale-categories
    25     locale-timezone)
    26 
    27   (require-library
    28     posix locale-posix locale-components locale-categories locale-timezone)
     19(import scheme chicken)
     20(use
     21  (only posix seconds->local-time local-timezone-abbreviation)
     22  locale-posix
     23  locale-components
     24  locale-categories
     25  locale-timezone)
    2926
    3027;;; When no environment info use Plan B
  • release/4/locale/trunk/locale-categories.scm

    r22482 r35363  
    44(module locale-categories
    55
    6   (;export
    7     ;
    8     make-locale-dictionary
    9     locale-dictionary?
    10     set-locale-dictionary-category!
    11     locale-dictionary-category
    12     ;
    13     current-locale-dictionary
    14     locale-category-ref
    15     set-locale-category!)
     6(;export
     7  ;
     8  make-locale-dictionary
     9  locale-dictionary?
     10  set-locale-dictionary-category!
     11  locale-dictionary-category
     12  ;
     13  current-locale-dictionary
     14  locale-category-ref
     15  set-locale-category!)
    1616
    17   (import
    18     scheme chicken
    19     #;srfi-9
    20     (only miscmacros define-parameter)
    21     lookup-table
    22     type-checks
    23     type-errors
    24     locale-components)
    25 
    26   (require-library
    27     #;srfi-9 miscmacros lookup-table
    28     type-checks type-errors
    29     locale-components)
     17(import scheme chicken)
     18(use
     19  #;srfi-9
     20  (only miscmacros define-parameter)
     21  lookup-table
     22  type-checks
     23  type-errors
     24  locale-components)
    3025
    3126;;;
  • release/4/locale/trunk/locale-components.scm

    r23530 r35363  
    1212(module locale-components
    1313
    14   (;export
    15     ;
    16     make-locale-components
    17     locale-components?
    18     check-locale-components
    19     error-locale-components
    20     locale-components=?
    21     locale-component-ref
    22     locale-component-exists?
    23     set-locale-component!
    24     update-locale-components!
    25     ;
    26     make-timezone-components
    27     timezone-components?
    28     check-timezone-components
    29     error-timezone-components
    30     set-timezone-component!
    31     timezone-component-ref
    32     update-timezone-components!
    33     ;
    34     timezone-offset?
    35     check-timezone-offset
    36     error-timezone-offset
    37     ;
    38     make-timezone-dst-rule-julian-leap
    39     timezone-dst-rule-julian-leap?
    40     check-timezone-dst-rule-julian-leap-day
    41     error-timezone-dst-rule-julian-leap-day
    42     ;
    43     make-timezone-dst-rule-julian-noleap
    44     timezone-dst-rule-julian-noleap?
    45     check-timezone-dst-rule-julian-noleap-day
    46     error-timezone-dst-rule-julian-noleap-day
    47     ;
    48     timezone-dst-rule-julian?
    49     timezone-dst-rule-julian
    50     ;
    51     make-timezone-dst-rule-mwd
    52     timezone-dst-rule-mwd?
    53     check-timezone-dst-rule-mwd
    54     error-timezone-dst-rule-mwd
    55     check-timezone-dst-rule-mwd-day
    56     error-timezone-dst-rule-mwd-day
    57     check-timezone-dst-rule-mwd-week
    58     error-timezone-dst-rule-mwd-week
    59     check-timezone-dst-rule-mwd-month
    60     error-timezone-dst-rule-mwd-month
    61     timezone-components=?
    62     timezone-dst-rule-day
    63     timezone-dst-rule-month
    64     timezone-dst-rule-week
    65     ;
    66     timezone-dst-rule-offset)
    67 
    68   (import
    69     scheme chicken
    70     (only srfi-1 last-pair every alist-cons fold)
    71     type-checks type-errors)
    72 
    73   (require-library srfi-1 type-checks type-errors)
     14(;export
     15  ;
     16  make-locale-components
     17  locale-components?
     18  check-locale-components
     19  error-locale-components
     20  locale-components=?
     21  locale-component-ref
     22  locale-component-exists?
     23  set-locale-component!
     24  update-locale-components!
     25  ;
     26  make-timezone-components
     27  timezone-components?
     28  check-timezone-components
     29  error-timezone-components
     30  set-timezone-component!
     31  timezone-component-ref
     32  update-timezone-components!
     33  ;
     34  timezone-offset?
     35  check-timezone-offset
     36  error-timezone-offset
     37  ;
     38  make-timezone-dst-rule-julian-leap
     39  timezone-dst-rule-julian-leap?
     40  check-timezone-dst-rule-julian-leap-day
     41  error-timezone-dst-rule-julian-leap-day
     42  ;
     43  make-timezone-dst-rule-julian-noleap
     44  timezone-dst-rule-julian-noleap?
     45  check-timezone-dst-rule-julian-noleap-day
     46  error-timezone-dst-rule-julian-noleap-day
     47  ;
     48  timezone-dst-rule-julian?
     49  timezone-dst-rule-julian
     50  ;
     51  make-timezone-dst-rule-mwd
     52  timezone-dst-rule-mwd?
     53  check-timezone-dst-rule-mwd
     54  error-timezone-dst-rule-mwd
     55  check-timezone-dst-rule-mwd-day
     56  error-timezone-dst-rule-mwd-day
     57  check-timezone-dst-rule-mwd-week
     58  error-timezone-dst-rule-mwd-week
     59  check-timezone-dst-rule-mwd-month
     60  error-timezone-dst-rule-mwd-month
     61  timezone-components=?
     62  timezone-dst-rule-day
     63  timezone-dst-rule-month
     64  timezone-dst-rule-week
     65  ;
     66  timezone-dst-rule-offset)
     67
     68(import scheme chicken)
     69(use
     70  (only srfi-1 last-pair every alist-cons fold)
     71  type-checks type-errors)
    7472
    7573;;;
     
    7775;;
    7876
    79 (define-inline (%->boolean obj) (and obj #t))
     77(define-inline (->boolean obj)
     78  (and obj #t))
    8079
    8180;;
     
    8988
    9089(define-inline (*locale-component-exists? loc lc what)
    91   (%->boolean (assq what lc)) )
     90  (->boolean (assq what lc)) )
    9291
    9392(define-inline (*locale-component-ref loc lc what def)
  • release/4/locale/trunk/locale-current.scm

    r23540 r35363  
    1010(module locale-current
    1111
    12   (;export
    13     current-timezone
    14     current-locale
    15     current-timezone-components
    16     current-locale-components
    17     locale-setup)
     12(;export
     13  current-timezone
     14  current-locale
     15  current-timezone-components
     16  current-locale-components
     17  locale-setup)
    1818
    19   (import
    20     scheme chicken
    21     (only posix seconds->local-time)
    22     (only type-errors warning-argument-type)
    23     locale-builtin
    24     locale-posix
    25     locale-components
    26     locale-categories)
    27 
    28   (require-library
    29     posix type-errors locale-builtin locale-posix
    30     locale-components locale-categories)
     19(import scheme chicken)
     20(use
     21  (only posix seconds->local-time)
     22  (only type-errors warning-argument-type)
     23  locale-builtin
     24  locale-posix
     25  locale-components
     26  locale-categories)
    3127
    3228;;;
  • release/4/locale/trunk/locale-posix.scm

    r23540 r35363  
    1313(module locale-posix
    1414
    15   (;export
    16     ;
    17     seconds->h:m:s-string
    18     ;
    19     make-posix-timezone
    20     ;
    21     posix-timezone-string->timezone-components
    22     posix-locale-string->locale-components
    23     gnu-language-string->locale-components
    24     ;
    25     posix-load-timezone
    26     posix-load-locale
    27     gnu-load-locale)
    28 
    29   (import chicken scheme)
    30   (require-extension
    31     srfi-1 srfi-13 regex data-structures files
    32     locale-categories locale-components)
     15(;export
     16  ;
     17  seconds->h:m:s-string
     18  ;
     19  make-posix-timezone
     20  ;
     21  posix-timezone-string->timezone-components
     22  posix-locale-string->locale-components
     23  gnu-language-string->locale-components
     24  ;
     25  posix-load-timezone
     26  posix-load-locale
     27  gnu-load-locale)
     28
     29(import chicken scheme)
     30(use
     31  srfi-1 srfi-13 regex data-structures files
     32  locale-categories locale-components)
    3333
    3434;;;
     
    105105                      (string-trim numstr (string-ref delm 0)) ) ) ) )
    106106            (parse-timecomp
    107               (lambda (numstr) 
     107              (lambda (numstr)
    108108                (parse-delmcomp numstr ":")) )
    109109            (parse-daterulecomp
  • release/4/locale/trunk/locale-timezone.scm

    r23540 r35363  
    44(module locale-timezone
    55
    6   (;export
    7     local-timezone-name
    8     local-timezone-offset
    9     local-timezone-name+offset
    10     with-tzset
    11     ;Deprecated
    12     local-timezone)
     6(;export
     7  local-timezone-name
     8  local-timezone-offset
     9  local-timezone-name+offset
     10  with-tzset
     11  ;Deprecated
     12  local-timezone)
    1313
    14   (import
    15     scheme chicken foreign
    16     (only posix
    17       time->string seconds->local-time local-time->seconds
    18       setenv unsetenv)
    19     (only type-checks
    20       check-minimum-argument-count check-argument-count
    21       check-fixnum)
    22     (only type-errors
    23       error-argument-count
    24       error-keyword error-argument-type))
    25 
    26   (require-library posix type-checks type-errors)
     14(import scheme chicken foreign)
     15(use
     16  (only posix
     17    time->string seconds->local-time local-time->seconds
     18    setenv unsetenv)
     19  (only type-checks
     20    check-minimum-argument-count check-argument-count
     21    check-fixnum)
     22  (only type-errors
     23    error-argument-count
     24    error-keyword error-argument-type))
    2725
    2826;;;
     
    7674        ;kwd dst? overrides vector elm
    7775        (let ((tv (car args)))
    78           (when (< (vector-length tv) 10) 
     76          (when (< (vector-length tv) 10)
    7977            (error-argument-type loc tv "ten element time vector") )
    8078          (set! dst? (vector-ref tv 8))
  • release/4/locale/trunk/locale.meta

    r27653 r35363  
    1414        (check-errors "1.12.2"))
    1515 (test-depends test)
    16  (files "locale.setup" "locale-timezone.scm" "locale-components.scm" "locale-current.scm" "locale-categories.scm" "locale-builtin.scm" "locale.release-info" "locale.meta" "locale-posix.scm" "tests/run.scm" "locale.scm") )
     16 (files
     17  "locale.meta" "locale.setup" "locale.release-info"
     18  "locale-timezone.scm"
     19  "locale-components.scm"
     20  "locale-current.scm"
     21  "locale-categories.scm"
     22  "locale-builtin.scm"
     23  "locale-posix.scm"
     24  "locale.scm"
     25  "tests/run.scm" "tests/locale-test.scm") )
  • release/4/locale/trunk/locale.scm

    r23540 r35363  
    88(module locale
    99
    10   (;export
    11     ;; locale-timezone
    12     local-timezone ;Deprecated
    13     local-timezone-name
    14     local-timezone-offset
    15     local-timezone-name+offset
    16     with-tzset
    17     ;; locale-builtin
    18     builtin-source-name builtin-source-name?
    19     unknown-timezone-name unknown-timezone-name?
    20     use-builtin-timezone
    21     use-builtin-locale
    22     use-builtin-language
    23     ;; locale-posix
    24     seconds->h:m:s-string
    25     make-posix-timezone
    26     posix-timezone-string->timezone-components
    27     posix-locale-string->locale-components
    28     gnu-language-string->locale-components
    29     posix-load-timezone
    30     posix-load-locale
    31     gnu-load-locale
    32     ;; locale-components
    33     ;
    34     make-locale-components
    35     locale-components?
    36     check-locale-components
    37     error-locale-components
    38     locale-components=?
    39     locale-component-ref
    40     locale-component-exists?
    41     set-locale-component!
    42     update-locale-components!
    43     ;
    44     make-timezone-components
    45     timezone-components?
    46     check-timezone-components
    47     error-timezone-components
    48     set-timezone-component!
    49     timezone-component-ref
    50     update-timezone-components!
    51     ;
    52     timezone-offset?
    53     check-timezone-offset
    54     error-timezone-offset
    55     ;
    56     make-timezone-dst-rule-julian-leap
    57     timezone-dst-rule-julian-leap?
    58     check-timezone-dst-rule-julian-leap-day
    59     error-timezone-dst-rule-julian-leap-day
    60     ;
    61     make-timezone-dst-rule-julian-noleap
    62     timezone-dst-rule-julian-noleap?
    63     check-timezone-dst-rule-julian-noleap-day
    64     error-timezone-dst-rule-julian-noleap-day
    65     ;
    66     timezone-dst-rule-julian?
    67     timezone-dst-rule-julian
    68     ;
    69     make-timezone-dst-rule-mwd
    70     timezone-dst-rule-mwd?
    71     check-timezone-dst-rule-mwd
    72     error-timezone-dst-rule-mwd
    73     check-timezone-dst-rule-mwd-day
    74     error-timezone-dst-rule-mwd-day
    75     check-timezone-dst-rule-mwd-week
    76     error-timezone-dst-rule-mwd-week
    77     check-timezone-dst-rule-mwd-month
    78     error-timezone-dst-rule-mwd-month
    79     timezone-components=?
    80     timezone-dst-rule-day
    81     timezone-dst-rule-month
    82     timezone-dst-rule-week
    83     ;
    84     timezone-dst-rule-offset
    85     ;; locale-categories
    86     make-locale-dictionary
    87     locale-dictionary?
    88     set-locale-dictionary-category!
    89     locale-dictionary-category
    90     current-locale-dictionary
    91     locale-category-ref
    92     set-locale-category!
    93     ;; locale-current
    94     current-timezone
    95     current-locale
    96     current-timezone-components
    97     current-locale-components
    98     locale-setup)
     10(;export
     11  ;; locale-timezone
     12  local-timezone ;Deprecated
     13  local-timezone-name
     14  local-timezone-offset
     15  local-timezone-name+offset
     16  with-tzset
     17  ;; locale-builtin
     18  builtin-source-name builtin-source-name?
     19  unknown-timezone-name unknown-timezone-name?
     20  use-builtin-timezone
     21  use-builtin-locale
     22  use-builtin-language
     23  ;; locale-posix
     24  seconds->h:m:s-string
     25  make-posix-timezone
     26  posix-timezone-string->timezone-components
     27  posix-locale-string->locale-components
     28  gnu-language-string->locale-components
     29  posix-load-timezone
     30  posix-load-locale
     31  gnu-load-locale
     32  ;; locale-components
     33  ;
     34  make-locale-components
     35  locale-components?
     36  check-locale-components
     37  error-locale-components
     38  locale-components=?
     39  locale-component-ref
     40  locale-component-exists?
     41  set-locale-component!
     42  update-locale-components!
     43  ;
     44  make-timezone-components
     45  timezone-components?
     46  check-timezone-components
     47  error-timezone-components
     48  set-timezone-component!
     49  timezone-component-ref
     50  update-timezone-components!
     51  ;
     52  timezone-offset?
     53  check-timezone-offset
     54  error-timezone-offset
     55  ;
     56  make-timezone-dst-rule-julian-leap
     57  timezone-dst-rule-julian-leap?
     58  check-timezone-dst-rule-julian-leap-day
     59  error-timezone-dst-rule-julian-leap-day
     60  ;
     61  make-timezone-dst-rule-julian-noleap
     62  timezone-dst-rule-julian-noleap?
     63  check-timezone-dst-rule-julian-noleap-day
     64  error-timezone-dst-rule-julian-noleap-day
     65  ;
     66  timezone-dst-rule-julian?
     67  timezone-dst-rule-julian
     68  ;
     69  make-timezone-dst-rule-mwd
     70  timezone-dst-rule-mwd?
     71  check-timezone-dst-rule-mwd
     72  error-timezone-dst-rule-mwd
     73  check-timezone-dst-rule-mwd-day
     74  error-timezone-dst-rule-mwd-day
     75  check-timezone-dst-rule-mwd-week
     76  error-timezone-dst-rule-mwd-week
     77  check-timezone-dst-rule-mwd-month
     78  error-timezone-dst-rule-mwd-month
     79  timezone-components=?
     80  timezone-dst-rule-day
     81  timezone-dst-rule-month
     82  timezone-dst-rule-week
     83  ;
     84  timezone-dst-rule-offset
     85  ;; locale-categories
     86  make-locale-dictionary
     87  locale-dictionary?
     88  set-locale-dictionary-category!
     89  locale-dictionary-category
     90  current-locale-dictionary
     91  locale-category-ref
     92  set-locale-category!
     93  ;; locale-current
     94  current-timezone
     95  current-locale
     96  current-timezone-components
     97  current-locale-components
     98  locale-setup)
    9999
    100   (import chicken scheme)
    101   (require-extension
    102     locale-timezone locale-builtin locale-posix locale-components
    103     locale-categories locale-current)
     100(import chicken scheme)
     101(use
     102  locale-timezone locale-builtin locale-posix locale-components
     103  locale-categories locale-current)
    104104
    105105) ;module locale
  • release/4/locale/trunk/locale.setup

    r27653 r35363  
    55(verify-extension-name "locale")
    66
    7 (setup-shared-extension-module 'locale-components (extension-version "0.6.13")
     7(setup-shared-extension-module 'locale-components (extension-version "0.7.0")
    88  #:compile-options '(
    99    -disable-interrupts
     
    1212    -no-procedure-checks))
    1313
    14 (setup-shared-extension-module 'locale-categories (extension-version "0.6.13")
     14(setup-shared-extension-module 'locale-categories (extension-version "0.7.0")
    1515  #:compile-options '(
    1616    -fixnum-arithmetic
     
    1818    -no-procedure-checks))
    1919
    20 (setup-shared-extension-module 'locale-posix (extension-version "0.6.13")
     20(setup-shared-extension-module 'locale-posix (extension-version "0.7.0")
    2121  #:compile-options '(
    2222    -fixnum-arithmetic
     
    2424    -no-procedure-checks))
    2525
    26 (setup-shared-extension-module 'locale-timezone (extension-version "0.6.13")
     26(setup-shared-extension-module 'locale-timezone (extension-version "0.7.0")
    2727  #:compile-options '(
    2828    -fixnum-arithmetic
     
    3030    -no-procedure-checks))
    3131
    32 (setup-shared-extension-module 'locale-builtin (extension-version "0.6.13")
     32(setup-shared-extension-module 'locale-builtin (extension-version "0.7.0")
    3333  #:compile-options '(
    3434    -fixnum-arithmetic
     
    3636    -no-procedure-checks))
    3737
    38 (setup-shared-extension-module 'locale-current (extension-version "0.6.13")
     38(setup-shared-extension-module 'locale-current (extension-version "0.7.0")
    3939  #:compile-options '(
    4040    -fixnum-arithmetic
     
    4242    -no-procedure-checks))
    4343
    44 (setup-shared-extension-module 'locale (extension-version "0.6.13"))
     44(setup-shared-extension-module 'locale (extension-version "0.7.0"))
  • release/4/locale/trunk/tests/run.scm

    r23540 r35363  
    1 ;;;; locale-test.scm
    21
    3 ; Remove ALL envvars
    4 (use posix)
    5 (for-each unsetenv
    6   '("TZ"
    7     "LANG"
    8     "LC_ALL"
    9     "LC_COLLATE"
    10     "LC_CTYPE"
    11     "LC_MESSAGES"
    12     "LC_MONETARY"
    13     "LC_NUMERIC"
    14     "LC_ADDRESS"
    15     "LC_IDENTIFICATION"
    16     "LC_MEASUREMENT"
    17     "LC_NAME"
    18     "LC_PAPER"
    19     "LC_TELEPHONE"
    20     "LC_TIME"
    21     "LANGUAGE"))
     2(define EGG-NAME "locale")
    223
    23 (use test)
    24 (use locale)
     4;chicken-install invokes as "<csi> -s run.scm <eggnam> <eggdir>"
    255
    26 ;Should test
    27 ;LC_ALL
    28 ;LC_COLLATE, etc.
    29 ;LANGUAGE
     6(use files)
    307
    31 (test-group "Locale"
     8;no -disable-interrupts
     9(define *csc-options* "-inline-global -scrutinize -optimize-leaf-routines -local -inline -specialize -unsafe -no-trace -no-lambda-info -clustering -lfa2")
    3210
    33   #; ;FIXME need to test locale-timezone
    34         (test-group "Local Timezone"
    35        
    36           (test "TZN (fail)" "" (local-timezone (seconds->local-time (current-seconds))))
    37           (test "TZO (fail)" -1 (local-timezone-offset (seconds->local-time (current-seconds))))
    38        
    39           #;(with-tzset "" (lambda () ))
    40         )
     11(define *args* (argv))
    4112
    42         (test-group "Posix Timezone"
     13(define (test-name #!optional (eggnam EGG-NAME))
     14  (string-append eggnam "-test") )
    4315
    44     ; unsupported but not an error
    45     (test-assert "T1" (not (posix-timezone-string->timezone-components ":foo,bar,baz")))
     16(define (egg-name #!optional (def EGG-NAME))
     17  (cond
     18    ((<= 4 (length *args*))
     19      (cadddr *args*) )
     20    (def
     21      def )
     22    (else
     23      (error 'test "cannot determine egg-name") ) ) )
    4624
    47     ; cannot have a name composed of digits
    48     (test-error "T2" (posix-timezone-string->timezone-components "23,foo"))
    49  
    50     ; this is actually legal!
    51     (test-assert "T3" (posix-timezone-string->timezone-components "foo/23"))
     25;;;
    5226
    53     ; this is actually legal!
    54                 (test-assert "T4" (posix-timezone-string->timezone-components "foo-23bar/23"))
     27(set! EGG-NAME (egg-name))
    5528
    56     ; the dst section is bad
    57     (test-error "T5" (posix-timezone-string->timezone-components "foo-23bar-22/23"))
     29(define (run-test #!optional (eggnam EGG-NAME) (cscopts *csc-options*))
     30  (let ((tstnam (test-name eggnam)))
     31    (print "*** csi ***")
     32    (system (string-append "csi -s " (make-pathname #f tstnam "scm")))
     33    (newline)
     34    (print "*** csc (" cscopts ") ***")
     35    (system (string-append "csc" " " cscopts " " (make-pathname #f tstnam "scm")))
     36    (system (make-pathname (cond-expand (unix "./") (else #f)) tstnam)) ) )
    5837
    59           (let ((tz0 (make-timezone-components "PST+8:00" "TEST"))
    60           (tz1 (make-timezone-components "PST+8:00PDT+7:00:00,M4.1.0,M10.5" '("POSIX" "TZ")))
    61           (tz2 (make-timezone-components "PST+8:00PDT7,J23/12:34,34/1:00:01" "TEST")) )
     38(define (run-tests eggnams #!optional (cscopts *csc-options*))
     39  (for-each (cut run-test <> cscopts) eggnams) )
    6240
    63       (set! tz0
    64         (update-timezone-components! tz0
    65           'std-name "PST" 'std-offset (* 8 60 60)))
    66       (test "TS1" tz0
    67         (posix-timezone-string->timezone-components "PST+8:00" "TEST"))
     41;;;
    6842
    69       (set! tz1
    70         (update-timezone-components! tz1
    71           'std-name "PST" 'std-offset (* 8 60 60)
    72           'dst-name "PDT" 'dst-offset (* 7 60 60)
    73           'dst-start (make-timezone-dst-rule-mwd 4 1 0 (* 2 60 60))
    74           'dst-end (make-timezone-dst-rule-mwd 10 5 0 (* 2 60 60))))
    75       (test "TS2" tz1
    76         (posix-timezone-string->timezone-components "PST+8:00PDT+7:00:00,M4.1.0,M10.5" '("POSIX" "TZ")))
    77 
    78       (set! tz2
    79         (update-timezone-components! tz2
    80           'std-name "PST" 'std-offset (* 8 60 60)
    81           'dst-name "PDT" 'dst-offset (* 7 60 60)
    82           'dst-start (make-timezone-dst-rule-julian-noleap 23 (+ (* 12 60 60) (* 34 60)))
    83           'dst-end (make-timezone-dst-rule-julian-leap 34 (+ (* 1 60 60) 1))))
    84       (test "TS3" tz2
    85         (posix-timezone-string->timezone-components "PST+8:00PDT7,J23/12:34,34/1:00:01" "TEST"))
    86 
    87       ;; This screws up any further testing of TZ related info
    88       (setenv "TZ" "PST+8:00PDT+7:00:00,M4.1.0,M10.5")
    89       (posix-load-timezone)
    90       (test "TS4" tz1 (current-timezone-components)) )
    91         )
    92 
    93   (test-group "Posix Locale"
    94 
    95           (let ((lc0 (make-locale-components "en_US" '("POSIX" "LANG")))
    96           (lc1 (make-locale-components "en-Latn_US.UTF8@foo,bar,baz" "TEST")) )
    97 
    98       (set! lc0
    99         (update-locale-components! lc0
    100           'language "en"
    101           'country "US"
    102           'region "US"))
    103       (set! lc1
    104         (update-locale-components! lc1
    105           'language "en"
    106           'script "Latn"
    107           'country "US"
    108           'region "US"
    109           'codeset "UTF8"
    110           'modifier "foo,bar,baz"))
    111 
    112       (test-assert "L1" (not (posix-locale-string->locale-components "/foo,bar,baz" "TEST")))
    113       (test-assert "L2" (not (posix-locale-string->locale-components "23,bar,baz" "TEST")))
    114       (test-assert "L3" (not (posix-locale-string->locale-components "foo-bar_1" "TEST")))
    115 
    116       (test-assert "LS1" (locale-components=? lc0 (posix-locale-string->locale-components "en_US" '("POSIX" "LANG"))))
    117       (test-assert "LS2" (locale-components=? lc1 (posix-locale-string->locale-components "en-Latn_US.UTF8@foo,bar,baz" "TEST")))
    118 
    119       (setenv "LANG" "en_US")
    120       (posix-load-locale)
    121       (test-assert "LS3" (locale-components=? lc0 (current-locale-components)))
    122       (test-assert "LS4" (locale-components=? lc0 (locale-category-ref 'monetary))) )
    123   )
    124 )
    125 
    126 (test-exit)
    127 
     43(run-test)
Note: See TracChangeset for help on using the changeset viewer.