Ejemplo n.º 1
0
    def equals3_test(self):
        L1 = buildRange(1, 5)
        L2 = buildRange(5, 9)

        # FEEDBACK
        print("Value of L1: ", L1)
        print("Value of L2: ", L2)
        print("Expect False: ", equals(L1, L2))

        self.assertFalse(equals(L1, L2))
Ejemplo n.º 2
0
    def equals1_test(self):
        L1 = buildRange(1, 5)
        L2 = buildRange(1, 5)

        # FEEDBACK
        print("Value of L1: ", L1)
        print("Value of L2: ", L2)
        print("Expect True: ", equals(L1, L2))

        self.assertTrue(equals(L1, L2))
Ejemplo n.º 3
0
    def equals2_test(self):
        L = buildRange(1, 2)
        L1 = rest(rest(L))
        L2 = rest(rest(L))

        # FEEDBACK
        print("Value of L1: ", L1)
        print("Value of L2: ", L2)
        print("Expect True: ", equals(L1, L2))

        self.assertTrue(equals(L1, L2))
Ejemplo n.º 4
0
  def removeall1_test(self):
    L1 = cons(2, cons(1, cons(2, cons(3, THE_EMPTY_LIST))))
    L2 = removeAll(2, L1)
    expected = cons(1, cons(3, THE_EMPTY_LIST))

    # FEEDBACK
    print("Starting list: ", L1)
    print("Expect (1 3): ", L2)    

    self.assertTrue(equals(L2, expected))