;;;;;;;;;;;;;;;;; ;; UNION tests ;; ;;;;;;;;;;;;;;;;; ;Test Case 1 (0.4 pts) (myunion '(a b c d) '(c d e f)) ;Result: (a b c d e f) ;Test Case 2 (0.4 pts) (myunion '() '()) ;Result: () ;Test Case 3 (0.4 pts) (myunion '(a) '()) ;Result: (a) ;Test Case 4 (0.4 pts) (myunion '(nil) '()) ;Result: (nil) ;Test Case 5 (0.3 pts) (myunion '(nil) '(a b c)) ;Result: (nil a b c) ;;;;;;;;;;;;;;;;;;;;;;;; ;; INTERSECTION tests ;; ;;;;;;;;;;;;;;;;;;;;;;;; ;Test Case 1 (0.4 pts) (myintersection '(a b c d) '(c d e f)) ;Result: (c d) ;Test Case 2 (0.4 pts) (myintersection '() '()) ;Result: () ;Test Case 3 (0.4 pts) (myintersection '(a) '()) ;Result: () ;Test Case 4 (0.4 pts) (myintersection '(nil) '(nil)) ;Result: (nil) ;Test Case 5 (0.3 pts) (myintersection '(nil) '(a b c)) ;Result: () ;;;;;;;;;;;;;;;;;;;;;;;; ;SET_DIFFERENCE tests ;; ;;;;;;;;;;;;;;;;;;;;;;;; ;Test Case 1 (0.4 pts) (set_difference '(a b c d) '(c d e f)) ;Result: (a b) ;Test Case 2 (0.4 pts) (set_difference '(nil a) '(a b c)) ;Result: (nil) ;Test Case 3 (0.4 pts) (set_difference '(nil) '(nil b)) ;Result: () ;;;;;;;;;;;;;;;; ;; MERGE test ;; ;;;;;;;;;;;;;;;; ;Test Case 1 (0.5 pts) (mymerge 5 '(1 2 3 8 10)) ;Result: (1 2 3 5 8 10) ;Test Case 2 (0.5 pts) (mymerge 1 '(1 2 3)) ;Result: (1 1 2 3) ;Test Case 3 (0.5 pts) (mymerge 5 '(1 2 3)) ;Result: (1 2 3 5) ;Test Case 4 (0.5 pts) (mymerge 4 '(1 2 3 4 5)) ;Result: (1 2 3 4 4 5) ;;;;;;;;;;;;;;;;;; ;; OUNION tests ;; ;;;;;;;;;;;;;;;;;; ;Test Case 1 (0.4 pts) (ounion '(1 2 3 8 10) '(0 1 4 5 9)) ;Result: (0 1 2 3 4 5 8 9 10) ;Test Case 2 (0.4 pts) (ounion '() '(1 2 3)) ;Result: (1 2 3) ;Test Case 3 (0.4 pts) (ounion '(1) '(1 2 4)) ;Result: (1 2 4) ;Test Case 4 (0.3 pts) (ounion '(1 2 3) '()) ;Result: (1 2 3) ;;;;;;;;;;;;;;;;;;;;;;;; ; OINTERSECTION tests ;; ;;;;;;;;;;;;;;;;;;;;;;;; ;Test Case 1 (0.4 pts) (ointersection '(1 2 3 8 10) '(0 1 4 5 9)) ;Result: (1) ;Test Case 2 (0.4 pts) (ointersection '() '(1)) ;Result: () ;Test Case 3 (0.4 pts) (ointersection '(1) '()) ;Result: () ;Test Case 4 (0.3 pts) (ointersection '() '()) ;Result: () ;Test Case 5 (0.4 pts) (ointersection '(1 2 3 4) '(1 2 3)) ;Result: (1 2 3) ;Test Case 6 (0.4 pts) (ointersection '(1 2 3) '(1 2 3 4)) ;Result: (1 2 3) ;;;;;;;;;;;;;;;;;;;;;;;;;; ; OSET_DIFFERENCE tests ;; ;;;;;;;;;;;;;;;;;;;;;;;;;; ;Test Case 1 (0.4 pts) (oset_difference '(1 2 3 8 10) '(0 1 4 5 9)) ;Result: (2 3 8 10) ;Test Case 2 (0.4 pts) (oset_difference '(1 2 4 6) '(3 4 5 6)) ;Result: (1 2) ;Test Case 3 (0.4 pts) (oset_difference '(1 5 7) '(0 2 5)) ;Result: (1 7) ;;;;;;;;;;;;;;;;; ;; MYSORT test ;; ;;;;;;;;;;;;;;;;; ;Test Case 1 (0.5 pts) (mysort '(10 5 20 3 1 2 11 18)) ;Result: (1 2 3 5 10 11 18 20) ;Test Case 2 (0.5 pts) (mysort '()) ;Result: () ;Test Case 3 (0.5 pts) (mysort '(9 7 5 3 1)) ;Result: (1 3 5 7 9) ;Test Case 4 (0.5 pts) (mysort '(9 9 9 7)) ;Result: (7 9 9 9) ;;;;;;;;;;;;;;;; ;; OCCUR test ;; ;;;;;;;;;;;;;;;; ;Test Case 1 (0.4 pts) (occur 'a '(((( a . b ) . c ) . d ) . ((( a . b ) . f ) . e ))) ;Result: T ;Test Case 2 (0.4 pts) (occur 'a '( b c d e)) ;Result: NIL ;Test Case 3 (0.4 pts) (occur nil '( b c a)) ;Result: T ;Test Case 4 (0.4 pts) (occur 'b '((((b))))) ;Result: T ;Test Case 5 (0.4 pts) (occur 'a '((((b))))) ;Result: NIL ;;;;;;;;;;;;;;;;;;;; ;; NUM_OCCUR test ;; ;;;;;;;;;;;;;;;;;;;; ;Test Case 1 (0.6 pts) (num_occur 'a '(((( a . b ) . c ) . d ) . ((( a . b ) . f ) . e ))) ;Result: 2 ;Test Case 2 (0.6 pts) (num_occur nil '( nil . nil )) ;Result: 2 ;Test Case 3 (0.6 pts) (num_occur 'a '(( b . b ) . (( a . a ) . ( b . a )))) ;Result: 3 ;Test Case 4 (0.6 pts) (num_occur 'a 'a) ;Result: 1 ;Test Case 5 (0.6 pts) (num_occur nil nil) ;Result: 1 ;;;;;;;;;;;;;;;;; ;; NODUPS test ;; ;;;;;;;;;;;;;;;;; ;Test Case 1 (0.6 pts) (nodups '(((( a . b ) . c ) . d ) . ((( a . b ) . f ) . e ))) ;Result: (a b c d e f) ;Test Case 2 (0.6 pts) (nodups '(a)) ;Result: (a nil) ;Test Case 3 (0.6 pts) (nodups '(((a)))) ;Result: (a nil) ;Test Case 4 (0.6 pts) (nodups '( a . a )) ;Result: (a) ;Test Case 5 (0.6 pts) (nodups nil) ;Result: (nil) ;;;;;;;;;;;;;;;;;;;;;;; ;; MULTIPLICITY test ;; ;;;;;;;;;;;;;;;;;;;;;;; ;Test Case 1 (0.8 pts) (multiplicity '(((( a . b ) . c ) . d ) . ((( a . b ) . f ) . e ))) ;Result: (( a . 2 ) ( b . 2 )) ;Test Case 2 (0.8 pts) (multiplicity '(( nil . nil ) . nil )) ;Result: (( nil . 3 ) ) ;Test Case 3 (0.8 pts) (multiplicity '(( nil . nil ) . ( a . a ))) ;Result: (( nil . 2 ) ( a . 2 )) ;Test Case 4 (0.8 pts) (multiplicity '(( a . a ) . ( a . b ))) ;Result: (( a . 3 ) ) ;Test Case 5 (0.8 pts) (multiplicity 'a) ;Result: () ;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; MULTI_OCCUR_SEXPR test ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Test Case 1 (0.7 pts) (multi_occur_sexpr '(((( a . b ) . c ) . d ) . ((( a . b ) . f ) . e )) '( a . b )) ;Result: T ;Test Case 1 (0.7 pts) (multi_occur_sexpr '( ( nil . a ) . nil ) nil) ;Result: T ;Test Case 1 (0.7 pts) (multi_occur_sexpr '(a nil) nil) ;Result: T ;Test Case 1 (0.7 pts) (multi_occur_sexpr '(( a . b ) . ( c . d )) '( b . a )) ;Result: NIL ;Test Case 1 (0.6 pts) (multi_occur_sexpr '( a . b ) '( c . a )) ;Result: NIL ;Test Case 1 (0.6 pts) (multi_occur_sexpr '(( a . nil ) a) '( a . nil)) ;Result: T