Refactor strings.el tests
Ensure that string.el follows the latest whim in my Elisp testing circus.
This commit is contained in:
		
							parent
							
								
									90955a3c02
								
							
						
					
					
						commit
						d1566dd0e6
					
				
					 1 changed files with 18 additions and 23 deletions
				
			
		| 
						 | 
					@ -12,11 +12,16 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(require 's)
 | 
					(require 's)
 | 
				
			||||||
(require 'dash)
 | 
					(require 'dash)
 | 
				
			||||||
 | 
					;; TODO: Resolve the circular dependency that this introduces.
 | 
				
			||||||
 | 
					;; (require 'prelude)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 | 
					;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 | 
				
			||||||
;; Library
 | 
					;; Library
 | 
				
			||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 | 
					;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(defconst string/test? t
 | 
				
			||||||
 | 
					  "When t, run the tests.")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
;; Strings
 | 
					;; Strings
 | 
				
			||||||
(defun string/hookify (x)
 | 
					(defun string/hookify (x)
 | 
				
			||||||
  "Append \"-hook\" to X."
 | 
					  "Append \"-hook\" to X."
 | 
				
			||||||
| 
						 | 
					@ -98,29 +103,19 @@
 | 
				
			||||||
;; Tests
 | 
					;; Tests
 | 
				
			||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 | 
					;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
;; TODO: Support these.
 | 
					;; (when string/test?
 | 
				
			||||||
;; (require 'macros)
 | 
					;;   (prelude/assert
 | 
				
			||||||
;; (macros/test
 | 
					;;    (string=
 | 
				
			||||||
;;  :function string/surround
 | 
					;;     (string/surround "-*-" "surround")
 | 
				
			||||||
;;  :test "works as expected"
 | 
					;;     "-*-surround-*-"))
 | 
				
			||||||
;;  :args '("-*-" "surround")
 | 
					;;   (prelude/assert
 | 
				
			||||||
;;  :expect "-*-surround-*-"
 | 
					;;    (string=
 | 
				
			||||||
;;  :equality string=)
 | 
					;;     (string/caps->kebab "CAPS_CASE_STRING")
 | 
				
			||||||
;
 | 
					;;     "caps-case-string"))
 | 
				
			||||||
;; (macros/test
 | 
					;;   (prelude/assert
 | 
				
			||||||
;;  :function string/caps->kebab
 | 
					;;    (string=
 | 
				
			||||||
;;  :test "works as expected"
 | 
					;;     (string/kebab->caps "kebab-case-string")
 | 
				
			||||||
;;  :args '("CAPS_CASE_STRING")
 | 
					;;     "KEBAB_CASE_STRING")))
 | 
				
			||||||
;;  :expect "caps-case-string"
 | 
					 | 
				
			||||||
;;  :equality string=)
 | 
					 | 
				
			||||||
;
 | 
					 | 
				
			||||||
;; ;; TODO: Generate :test from docs of defun.
 | 
					 | 
				
			||||||
;; (macros/test
 | 
					 | 
				
			||||||
;;  :function string/kebab->caps
 | 
					 | 
				
			||||||
;;  :test "works as expected"
 | 
					 | 
				
			||||||
;;  :args '("kebab-case-string")
 | 
					 | 
				
			||||||
;;  :expect "KEBAB_CASE_STRING"
 | 
					 | 
				
			||||||
;;  :equality =)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
(provide 'string)
 | 
					(provide 'string)
 | 
				
			||||||
;;; string.el ends here
 | 
					;;; string.el ends here
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue