disable raise ... from ... unittest in py3 (but other syntax checks still work)
[cython.git] / tests / run / str_char_coercion_T412.pyx
1 cdef int   i = 'x'
2 cdef char  c = 'x'
3 cdef char* s = 'x'
4
5 def test_eq():
6     """
7     >>> test_eq()
8     True
9     True
10     True
11     True
12     """
13     print i ==  'x'
14     print i == c'x'
15     print c ==  'x'
16     print c == c'x'
17 #    print s ==  'x' # error
18 #    print s == c'x' # error
19
20 def test_cascaded_eq():
21     """
22     >>> test_cascaded_eq()
23     True
24     True
25     True
26     True
27     True
28     True
29     True
30     True
31     """
32     print  'x' == i ==  'x'
33     print  'x' == i == c'x'
34     print c'x' == i ==  'x'
35     print c'x' == i == c'x'
36
37     print  'x' == c ==  'x'
38     print  'x' == c == c'x'
39     print c'x' == c ==  'x'
40     print c'x' == c == c'x'
41
42 def test_cascaded_ineq():
43     """
44     >>> test_cascaded_ineq()
45     True
46     True
47     True
48     True
49     True
50     True
51     True
52     True
53     """
54     print  'a' <= i <=  'z'
55     print  'a' <= i <= c'z'
56     print c'a' <= i <=  'z'
57     print c'a' <= i <= c'z'
58
59     print  'a' <= c <=  'z'
60     print  'a' <= c <= c'z'
61     print c'a' <= c <=  'z'
62     print c'a' <= c <= c'z'
63
64 def test_long_ineq():
65     """
66     >>> test_long_ineq()
67     True
68     """
69     print 'a' < 'b' < 'c' < 'd' < c < 'y' < 'z'
70
71 def test_long_ineq_py():
72     """
73     >>> test_long_ineq_py()
74     True
75     True
76     """
77     print 'abcdef' < 'b' < 'c' < 'd' < 'y' < 'z'
78     print 'a' < 'b' < 'cde' < 'd' < 'y' < 'z'