def test_arg_ClrReference(self):
     import clr
     from IronPythonTest.BinderTest import C1, C2, COverloads_ClrReference
     target = COverloads_ClrReference()
     for (arg, mapping, funcTypeError, funcOverflowError) in [
         (
             lambda: None,
             _merge(_first('M100 M101 M107 '),
                    _second('M102 M104 M105 M106 ')),
             'M103 ',
             '',
         ),
         (
             lambda: clr.Reference[object](None),
             _second('M100 M104 M105 M107 '),
             'M101 M102 M103 M104 M106 ',
             '',
         ),
         (
             lambda: clr.Reference[object](None),
             _second('M100 M104 M105 M107 '),
             'M101 M102 M103 M106 ',
             '',
         ),
         (
             lambda: clr.Reference[int](9),
             _merge(_first('M100 M102 M103 M104 '), _second('M105 M107 ')),
             'M101 M106 ',
             '',
         ),
         (
             lambda: clr.Reference[bool](True),
             _merge(_first('M100 M105 '), _second('M101 M102 M104 M107 ')),
             'M103 M106 ',
             '',
         ),
         (
             lambda: clr.Reference[type](complex),
             _merge(_first('M100 '), _second('M104 M105 M107 ')),
             'M101 M102 M103 M106 ',
             '',
         ),
         (
             lambda: clr.Reference[C1](C1()),
             _merge(_first('M100 M106 M107 '), _second('M104 M105 ')),
             'M101 M102 M103 ',
             '',
         ),
         (
             lambda: clr.Reference[C1](C2()),
             _merge(_first('M100 M106 M107 '), _second('M104 M105 ')),
             'M101 M102 M103 ',
             '',
         ),
     ]:
         self._try_arg(target, arg, mapping, funcTypeError,
                       funcOverflowError)
Пример #2
0
 def test_arg_UserDefined(self):
     from IronPythonTest.BinderTest import C1, C2, C3, C6, S1, COverloads_UserDefined
     target = COverloads_UserDefined()
     for (arg, mapping, funcTypeError, funcOverflowError) in [
         (           C1(), _merge(_first('M101 M102 M103 M104 '), _second('M100 ')), 'M105 ', '', ),
         (           C2(), _merge(_first('M102 M103 '), _second('M100 M101 M104 ')), 'M105 ', '', ),
         (           C3(), _second('M103 '), 'M100 M101 M102 M104 M105 ', '', ),
         (           S1(), _first('M100 M101 M102 M103 '), 'M104 M105 ', '', ),
         (           C6(), _second('M103 M105 '), 'M100 M101 M102 M104 ', '', ),
         (     self.pt_i,  _first('M100 M101 M102 M103 '), 'M104 M105 ', '', ),
         (     self.pt_c1, _merge(_first('M101 M102 M103 M104 '), _second('M100 ')), 'M105 ', '', ),
         (  self.pt_i_int, _first('M100 M101 M102 M103 '), 'M104 M105 ', '', ),
         (self.pt_int_old, _second('M102 M103 '), 'M100 M101 M104 M105 ', '', ),
         (self.pt_int_new, _second('M102 M103 '), 'M100 M101 M104 M105 ', '', ),
         ]:
         self._try_arg(target, arg, mapping, funcTypeError, funcOverflowError)