Exemplo n.º 1
0
def has_correct_output():
    print('Checking output for 5*4...')
    if basetest.simple_test(list(sys.argv[1]), [5, 4], [20]):
        print('Correct output :)')
    else:
        print('Failed to output the correct value')
    print('')
Exemplo n.º 2
0
def has_correct_true():
    print('Checking output for if true...')
    if basetest.simple_test(list(sys.argv[1]), [1, 5, 4], [5]):
        print('Correct output :)')
    else:
        print('Failed to output the correct value')
    print('')
Exemplo n.º 3
0
def passes_random_inputs():
    print('Checking output with random inputs...')
    passes = True
    iterations = 50
    for i in range(0, iterations):
        x = random.randint(1, 40)
        y = random.randint(1, 40)
        if not basetest.simple_test(list(sys.argv[1]), [x, y], [x * y]):
            passes = False
            break
    if passes:
        print('Correct output on', iterations, 'random tests :)')
    else:
        print('Failed to output the correct value on random tests')
    print('')