Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
eb2261ce
Commit
eb2261ce
authored
Feb 03, 2012
by
Ian Lynagh
Browse files
Move lib/Time tests into the old-time package
parent
c8755c9a
Changes
10
Hide whitespace changes
Inline
Side-by-side
testsuite/tests/lib/Time/Makefile
deleted
100644 → 0
View file @
c8755c9a
TOP
=
../../..
include
$(TOP)/mk/boilerplate.mk
include
$(TOP)/mk/test.mk
testsuite/tests/lib/Time/T5430.hs
deleted
100644 → 0
View file @
c8755c9a
import
System.Locale
import
System.Time
main
::
IO
()
main
=
do
let
clockTime
=
TOD
32400
0
-- 00:00:00 on 1 Jan 1970
calTime
<-
toCalendarTime
clockTime
-- We check for 001 or 365 (timezone locale will determine which one)
-- and output 001 for testing output consistently.
putStrLn
$
case
(
formatCalendarTime
defaultTimeLocale
"%j"
calTime
)
of
"001"
->
"001"
-- good!
"365"
->
"001"
-- good!
n
->
n
-- error!
testsuite/tests/lib/Time/T5430.stdout
deleted
100644 → 0
View file @
c8755c9a
001
testsuite/tests/lib/Time/all.T
deleted
100644 → 0
View file @
c8755c9a
test
('
time002
',
normal
,
compile_and_run
,
[''])
test
('
time003
',
normal
,
compile_and_run
,
[''])
test
('
time004
',
normal
,
compile_and_run
,
[''])
test
('
T5430
',
normal
,
compile_and_run
,
[''])
testsuite/tests/lib/Time/time002.hs
deleted
100644 → 0
View file @
c8755c9a
import
System.Time
-- !!! check that we can read the current ClockTime, convert it
-- !!! to CalendarTime and back again, and that all three times when
-- !!! converted to strings compare equal.
main
=
do
t
<-
getClockTime
let
clock
=
show
t
c
<-
toCalendarTime
t
let
cal
=
calendarTimeToString
c
let
t2
=
toClockTime
c
clock2
=
show
t2
if
(
clock
==
cal
&&
clock
==
clock2
)
then
putStrLn
"Ok."
else
putStrLn
"Failed."
testsuite/tests/lib/Time/time002.stdout
deleted
100644 → 0
View file @
c8755c9a
Ok.
testsuite/tests/lib/Time/time003.hs
deleted
100644 → 0
View file @
c8755c9a
import
System.Time
main
::
IO
()
main
=
do
time
<-
getClockTime
print
(
plausible
(
show
time
))
let
(
CalendarTime
year
month
mday
hour
min
sec
psec
wday
yday
timezone
gmtoff
isdst
)
=
toUTCTime
time
time2
=
wdays
!!
fromEnum
wday
++
(
' '
:
months
!!
fromEnum
month
)
++
(
' '
:
shows2
mday
(
' '
:
shows2
hour
(
':'
:
shows2
min
(
':'
:
shows2
sec
(
' '
:
timezone
++
' '
:
shows
year
"
\n
"
)))))
print
(
plausible
time2
)
where
wdays
=
[
"Sun"
,
"Mon"
,
"Tue"
,
"Wed"
,
"Thu"
,
"Fri"
,
"Sat"
]
months
=
[
"Jan"
,
"Feb"
,
"Mar"
,
"Apr"
,
"May"
,
"Jun"
,
"Jul"
,
"Aug"
,
"Sep"
,
"Oct"
,
"Nov"
,
"Dec"
]
shows2
x
=
showString
(
pad2
x
)
pad2
x
=
case
show
x
of
c
@
[
_
]
->
'0'
:
c
cs
->
cs
plausible
str
=
filter
(
==
':'
)
str
==
"::"
\ No newline at end of file
testsuite/tests/lib/Time/time003.stdout
deleted
100644 → 0
View file @
c8755c9a
True
True
testsuite/tests/lib/Time/time004.hs
deleted
100644 → 0
View file @
c8755c9a
import
System.Time
main
::
IO
()
main
=
do
time
<-
getClockTime
let
(
CalendarTime
year
month
mday
hour
min
sec
psec
wday
yday
timezone
gmtoff
isdst
)
=
toUTCTime
time
time'
=
toClockTime
(
CalendarTime
(
year
-
1
)
month
mday
hour
min
sec
psec
wday
yday
timezone
gmtoff
isdst
)
print
(
length
(
show
time
)
==
length
(
show
time'
))
testsuite/tests/lib/Time/time004.stdout
deleted
100644 → 0
View file @
c8755c9a
True
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment