Beispiel #1
0
 def test_field_annotation_in_instruction_invalid_character(self, client):
     assert_typecheck_data_failure(
         client,
         '{ CAR %. }',
         'lambda (pair (nat %.) (int %.)) nat',
         'unexpected annotation',
     )
Beispiel #2
0
 def test_field_annotation_in_type_invalid_character(self, client):
     assert_typecheck_data_failure(
         client,
         'Pair 0 0',
         'pair (nat %.) (int %.)',
         'unexpected annotation',
     )
Beispiel #3
0
 def test_annotation_length_failure(self, client: Client):
     assert_typecheck_data_failure(
         client,
         '3',
         f"(int :{'a' * 255})",
         r'annotation exceeded maximum length \(255 chars\)',
     )
Beispiel #4
0
 def test_order_of_pairs(self, client):
     # tests that badly-ordered set literals are rejected
     utils.assert_typecheck_data_failure(client,
                                         '{Pair 0 "foo"; Pair 0 "bar"}',
                                         '(set (pair nat string))')
     utils.assert_typecheck_data_failure(client,
                                         '{Pair 1 "bar"; Pair 0 "foo"}',
                                         '(set (pair nat string))')
Beispiel #5
0
 def test_non_comparable_non_comb_pair(self, client):
     # tests that non-comb pairs are rejected by the typechecker
     utils.assert_typecheck_data_failure(client, '{}',
                                         '(set (pair (pair nat nat) nat))')