示例#1
0
from simple.types import IO

cases = ([IO([0, 1], -1)], \
         [IO([0, 0], 0)],
         [IO([0, 0], 0), IO([1, -1], 2)],
         [IO([10**100, 10**100], 0)],
         [IO([10**100, 10**250], 10**100 - 10**250)],
         )
示例#2
0
from simple.types import IO

cases = (
    [IO(('outsystems.com', ), 10)],
    [IO(('outsystems.com', '.'), 10)],
    [IO(('outsystems.com', ), 10),
     IO(('cmu.edu', ), 3)],

    # Adding more '.' shouldn't confuse the synthesizer.
    [IO(('outsystems.com', ), 10),
     IO(('abc.gmail.com', ), 3)],
)
示例#3
0
from simple.types import IO

cases = (
    # 0: Size 2
    [IO(('John', 'Doe'), 'John Doe')],

    # 1: Size 2
    [
        IO(('John', 'Doe'), 'John Doe'),
        IO(('Anne', 'Smith'), 'Anne Smith'),
    ],

    # 2: Size 3
    [
        IO(('John', 'Doe', '-Odoi'), 'John Doe-Odoi'),
    ],

    # 3: Size 3
    [
        IO(('John', 'Doe', '-Odoi'), 'John Doe-Odoi'),
        IO(('Anne', 'Smith', '-Sonian'), 'Anne Smith-Sonian'),
    ],

    # 4: Size 3, learning the prefix
    [
        IO(('John', 'Doe'), 'Dr. John Doe'),
    ],

    # 5: Size 3, learning the prefix
    [
        IO(('John', 'Doe'), 'Dr. John Doe'),
示例#4
0
from simple.types import IO

cases = ([IO([0, 1], 1)], \
         [IO([0, 0], 0)],
         [IO([0, 0], 0), IO([-1, 1], 0)],
         [IO([-10**100, 10**100], 0)],
         [IO([10**100, 10**250], 10**100 + 10**250)],
         )
示例#5
0
from simple.types import IO

cases = (
    [
        IO(('Text longer than thirty characters.', ),
           'Text longer than thirty charac')
    ],
    [
        IO(('Text longer than thirty characters.', ),
           'Text longer than thirty charac'),
        IO(('Small text.', ), 'Small text.')
    ],
    [
        IO(('Text longer than thirty characters.', ),
           'Text longer than thirty charac'),
        IO(('Small text.', ), 'Small text.'),
        IO(('This text is also longer than thirty characters.', ),
           'This text is also longer than ')
    ],
    [IO(('01/04/2000', ), '01')],
    [IO(('01/04/2000', ), '01'),
     IO(('02/05/2000', ), '02')],
    [IO(('01/04/2000', ), '04')],
    [IO(('01/04/2000', ), '04'),
     IO(('02/05/2000', ), '05')],
    [IO(('01/04/2000', ), '2000')],
    [IO(('01/04/2000', ), '2000'),
     IO(('02/05/2001', ), '2001')],
    [IO(('#01-04-2000#', ), '2000')],
    [IO(('#01-04-2000#', ), '2000'),
     IO(('#02-05-2001#', ), '2001')],
示例#6
0
from simple.types import IO

cases = (
    # 00
    [IO(('outsystems.com', ), 'outsystems')],
    # 01
    [IO(('outsystems.com', ), 'outsystems'),
     IO(('cmu.edu', ), 'cmu')],
    # 02
    [
        IO(('outsystems.com', ), 'outsystems'),
        IO(('cmu.edu', ), 'cmu'),
        IO(('tecnico.pt', ), 'tecnico')
    ],
    # 03
    [IO(('outsystems.com', '.'), 'outsystems'),
     IO(('cmu.edu', '.'), 'cmu')],
    # 04
    [
        IO(('www.outsystems.com', ), 'outsystems'),
        IO(('www.cmu.edu', ), 'cmu'),
        IO(('www.tecnico.pt', ), 'tecnico')
    ],
    # 05
    [
        IO(('www.outsystems.com', ), 'outsystems'),
        IO(('www.cmu.edu', ), 'cmu'),
        IO(('www3.tecnico.pt', ), 'tecnico')
    ],
    # 06
    [
示例#7
0
from simple.types import IO

cases = (
    [
        IO(('Text longer than thirty characters.', ),
           'Text longer than thirty charac...')
    ],
    [
        IO(('Text longer than thirty characters.', ),
           'Text longer than thirty charac...'),
        IO(('Small text.', ), 'Small text.')
    ],
    [
        IO(('Text longer than thirty characters.', ),
           'Text longer than thirty charac...'),
        IO(('Small text.', ), 'Small text.'),
        IO(('This text is also longer than thirty characters.', ),
           'This text is also longer than ...')
    ],
)
示例#8
0
from simple.types import IO

cases = (
    [IO(('abc', ), 3)],
    [IO(('abc', ), 3), IO(('rodrigo', ), 7)],
    [IO(('abc', ), 3),
     IO(('rodrigo', ), 7),
     IO(('pedro', ), 5)],
)
示例#9
0
from simple.types import IO

cases = (
    [IO([' abc '], 'abc')],
    [IO(['  abc'], 'abc')],
    [IO(['abc  '], 'abc')],
    [IO(['\tabc\t \n'], 'abc')],
    [IO(['   a b c   '], 'a b c')],
)
示例#10
0
from simple.types import IO

cases = ([IO(['abc'], 'abc')], \
         [IO(['ABC'], 'abc')],
         [IO(['aBc'], 'abc')],
         [IO(['aBC'], 'abc')],
         [IO(['a B C'], 'a b c')],
         )
示例#11
0
from simple.types import IO

# NewLine takes no inputs.
cases = ([IO([], '\n')], \
         )
示例#12
0
def read_one_example(ex: Dict[str, Dict[str, str]]) -> IO:
    inputs = tuple(read_value(val) for val in ex["inputs"])
    output = read_value(ex["output"])
    return IO(inputs, output)
示例#13
0
from simple.types import IO

cases = ( \
    [IO(['abc'], 'ABC')], \
    [IO(['ABC'], 'ABC')],
    [IO(['aBc'], 'ABC')],
    [IO(['aBC'], 'ABC')],
    [IO(['a B C'], 'A B C')],
         )