fix(wpcarro/emacs): Use should macro in set.el tests
Uncovered a few misconfigured tests by consuming the `should` macro. Change-Id: Ie0204818ecf1f6f5a0feafa85e4e100fb91b8865 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6011 Reviewed-by: wpcarro <wpcarro@gmail.com> Autosubmit: wpcarro <wpcarro@gmail.com> Tested-by: BuildkiteCI
This commit is contained in:
		
							parent
							
								
									6686c6d693
								
							
						
					
					
						commit
						5c99ba9702
					
				
					 1 changed files with 40 additions and 49 deletions
				
			
		|  | @ -11,68 +11,59 @@ | ||||||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||||||
| 
 | 
 | ||||||
| (ert-deftest set-from-list () | (ert-deftest set-from-list () | ||||||
|   (equal '(1 2 3) |   (should (equal '(1 2 3) | ||||||
|          (->> '(1 2 3 1 2 3) |                  (->> '(1 2 3 1 2 3) | ||||||
|               set-from-list |                       set-from-list | ||||||
|               set-to-list))) |                       set-to-list)))) | ||||||
| 
 | 
 | ||||||
| (ert-deftest set-distinct? () | (ert-deftest set-distinct? () | ||||||
|   (and |   (should (set-distinct? (set-new 'one 'two 'three) | ||||||
|    (set-distinct? (set-new 'one 'two 'three) |                          (set-new 'a 'b 'c))) | ||||||
|                   (set-new 'a 'b 'c)) |   (should (not | ||||||
|    (not |            (set-distinct? (set-new 1 2 3) | ||||||
|     (set-distinct? (set-new 1 2 3) |                           (set-new 3 4 5)))) | ||||||
|                    (set-new 3 4 5))) |   (should (not | ||||||
|    (not |            (set-distinct? (set-new 1 2 3) | ||||||
|     (set-distinct? (set-new 1 2 3) |                           (set-new 1 2 3))))) | ||||||
|                    (set-new 1 2 3))))) |  | ||||||
| 
 | 
 | ||||||
| (ert-deftest set-equal? () | (ert-deftest set-equal? () | ||||||
|   (and |   (should (not (set-equal? (set-new 'a 'b 'c) | ||||||
|    (set-equal? (set-new 'a 'b 'c) |                            (set-new 'x 'y 'z)))) | ||||||
|                (set-new 'x 'y 'z)) |   (should (not (set-equal? (set-new 'a 'b 'c) | ||||||
|    (set-equal? (set-new 'a 'b 'c) |                            (set-new 'a 'b)))) | ||||||
|                (set-new 'a 'b)) |   (should (set-equal? (set-new 'a 'b 'c) | ||||||
|    (set-equal? (set-new 'a 'b 'c) |                       (set-new 'a 'b 'c)))) | ||||||
|                (set-new 'a 'b 'c)))) |  | ||||||
| 
 | 
 | ||||||
| (ert-deftest set-intersection () | (ert-deftest set-intersection () | ||||||
|   (set-equal? (set-new 2 3) |   (should (set-equal? (set-new 2 3) | ||||||
|               (set-intersection (set-new 1 2 3) |                       (set-intersection (set-new 1 2 3) | ||||||
|                                 (set-new 2 3 4)))) |                                         (set-new 2 3 4))))) | ||||||
| 
 | 
 | ||||||
| (ert-deftest set-to/from-list () | (ert-deftest set-to/from-list () | ||||||
|   (equal '(1 2 3) |   (should (equal '(1 2 3) | ||||||
|          (->> '(1 1 2 2 3 3) |                  (->> '(1 1 2 2 3 3) | ||||||
|               set-from-list |                       set-from-list | ||||||
|               set-to-list))) |                       set-to-list)))) | ||||||
| 
 | 
 | ||||||
| (ert-deftest set-subset? () | (ert-deftest set-subset? () | ||||||
|   (let ((primary-colors (set-new "red" "green" "blue"))) |   (should (not (set-subset? (set-new "black" "grey") | ||||||
|     ;; set-subset? |                             (set-new "red" "green" "blue")))) | ||||||
|     (and |   (should (set-subset? (set-new "red") | ||||||
|      (set-subset? (set-new "black" "grey") |                        (set-new "red" "green" "blue")))) | ||||||
|                   primary-colors) |  | ||||||
|      (set-subset? (set-new "red") |  | ||||||
|                   primary-colors)))) |  | ||||||
| 
 | 
 | ||||||
| (ert-deftest set-subset/superset? () | (ert-deftest set-superset? () | ||||||
|   (let ((primary-colors (set-new "red" "green" "blue"))) |   (let ((primary-colors (set-new "red" "green" "blue"))) | ||||||
|     ;; set-subset? |     (should (not (set-superset? primary-colors | ||||||
|     (and |                                 (set-new "black" "grey")))) | ||||||
|      (not (set-superset? primary-colors |     (should (set-superset? primary-colors | ||||||
|                          (set-new "black" "grey"))) |                            (set-new "red" "green" "blue"))) | ||||||
|      (set-superset? primary-colors |     (should (set-superset? primary-colors | ||||||
|                     (set-new "red" "green" "blue")) |                            (set-new "red" "blue"))))) | ||||||
|      (set-superset? primary-colors |  | ||||||
|                     (set-new "red" "blue"))))) |  | ||||||
| 
 | 
 | ||||||
| (ert-deftest set-empty? () | (ert-deftest set-empty? () | ||||||
|   (and |   (should (set-empty? (set-new))) | ||||||
|    (set-empty? (set-new)) |   (should (not (set-empty? (set-new 1 2 3))))) | ||||||
|    (set-empty? (set-new 1 2 3)))) |  | ||||||
| 
 | 
 | ||||||
| (ert-deftest set-count () | (ert-deftest set-count () | ||||||
|   (and |   (should (= 0 (set-count (set-new)))) | ||||||
|    (= 0 (set-count (set-new))) |   (should (= 2 (set-count (set-new 1 1 2 2))))) | ||||||
|    (= 2 (set-count (set-new 1 1 2 2))))) |  | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue