Print this page
11919 date_test needs to set LC_TIME
Reviewed by: Paul Winder <paul@winders.demon.co.uk>
   1 #!/bin/ksh
   2 #
   3 # This file and its contents are supplied under the terms of the
   4 # Common Development and Distribution License ("CDDL"), version 1.0.
   5 # You may only use this file in accordance with the terms of version
   6 # 1.0 of the CDDL.
   7 #
   8 # A full copy of the text of the CDDL should have accompanied this
   9 # source.  A copy of the CDDL is also available via the Internet at
  10 # http://www.illumos.org/license/CDDL.
  11 #
  12 
  13 #
  14 # Copyright (c) 2017, Joyent, Inc.
  15 #
  16 
  17 #
  18 # Basic tests of date -r.
  19 #
  20 
  21 #
  22 # Make sure that we're executing in the C locale and that a given user's
  23 # locale doesn't impact this test.
  24 #
  25 export LANG=C
  26 
  27 date_arg0="$(basename $0)"
  28 date_prog=/usr/bin/date
  29 date_curcmd=
  30 
  31 fatal()
  32 {
  33         typeset msg="$*"
  34         [[ -z "$msg" ]] && msg="failed"
  35         echo "TEST FAILED: $date_arg0: $msg" >&2
  36         exit 1
  37 }
  38 
  39 compare()
  40 {
  41         typeset time=$1
  42         typeset exp=$2
  43         typeset tz=$3
  44         typeset val ret
  45 


   1 #!/bin/ksh
   2 #
   3 # This file and its contents are supplied under the terms of the
   4 # Common Development and Distribution License ("CDDL"), version 1.0.
   5 # You may only use this file in accordance with the terms of version
   6 # 1.0 of the CDDL.
   7 #
   8 # A full copy of the text of the CDDL should have accompanied this
   9 # source.  A copy of the CDDL is also available via the Internet at
  10 # http://www.illumos.org/license/CDDL.
  11 #
  12 
  13 #
  14 # Copyright 2019 Joyent, Inc.
  15 #
  16 
  17 #
  18 # Basic tests of date -r.
  19 #
  20 
  21 export LC_ALL=C




  22 
  23 date_arg0="$(basename $0)"
  24 date_prog=/usr/bin/date
  25 date_curcmd=
  26 
  27 fatal()
  28 {
  29         typeset msg="$*"
  30         [[ -z "$msg" ]] && msg="failed"
  31         echo "TEST FAILED: $date_arg0: $msg" >&2
  32         exit 1
  33 }
  34 
  35 compare()
  36 {
  37         typeset time=$1
  38         typeset exp=$2
  39         typeset tz=$3
  40         typeset val ret
  41