summaryrefslogtreecommitdiff
path: root/Examples/test-suite/python/types_directive_runme.py
blob: 401e3ae1d86d74ab8850009f73fd1c377f6cc833 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
from types_directive import *

d1 = Time1(2001, 2, 3, 60)
# check that a Time1 instance is accepted where Date is expected
newDate = add(d1, 7)
if newDate.day != 10:
    raise RuntimeError

d2 = Time2(1999, 8, 7, 60)
# check that a Time2 instance is accepted where Date is expected
newDate = add(d2, 7)
if newDate.day != 14:
    raise RuntimeError