예제 #1
0
def testVariance1():
    assert variance(Array((5, ), [7, 7, 8, 8, 3])) == 3.0
예제 #2
0
def testMin():
    assert min_element(Array((5, ), [7, 0, 8, 8, 3])) == 0.0
예제 #3
0
def testMean1():
    assert mean(Array((1, ), [5])) == 5.0
예제 #4
0
def testVariance():
    assert variance(Array((5, ), [1, 2, 3, 4, 5])) == 2.0
예제 #5
0
def testPrint():
    assert str(Array((1, ), True)) == "Array has 1 value(s) of type: boolean."
예제 #6
0
def testMean():
    assert mean(Array((3, ), [8, 8, 5])) == 7.0
예제 #7
0
def testIsEq():
    assert is_equal(Array((4, ), [5, 5, 4, 5]), Array(
        (4, ), [5, 2, 4, 5])) == [True, False, True, True]
예제 #8
0
def testSub():
    assert sub(Array((5, ), [5, 4, 3, 10, 8]), 3) == [5, 4, 10, 8]
예제 #9
0
def testEq():
    assert eq(Array((4, ), [5, 5, 4, 5]), Array((4, ), [5, 2, 4, 5])) == False
예제 #10
0
def testEq1():
    assert eq(Array((4, ), [5, 2, 4, 5]), Array((4, ), [5, 2, 4, 5])) == True
예제 #11
0
def testMul1():
    assert mul(Array((4, ), [5, 2, 42, 50]), 0) == [0, 0, 0, 0]
예제 #12
0
def testMul():
    assert mul(Array((3, ), [8, 8, 5]), 10) == [80, 80, 50]
예제 #13
0
def testSub1():
    assert sub(Array((2, ), [8, 10]), 8) == [10]
예제 #14
0
def testMin1():
    assert min_element(Array((4, ), [7, 12, 8, 8])) == 7.0
예제 #15
0
def testIsEq1():
    assert is_eq(Array((4, ), [5, 2, 4, 5]), 3) == [False, False, False, False]
예제 #16
0
def testAdd():
    assert add(Array((3, ), [5, 4, 3]), 10) == [5, 4, 3, 10]
예제 #17
0
def testAdd1():
    assert add(Array((4, ), [5, 4, 3, 11]), 25) == [5, 4, 3, 11, 25]