Commits

Shlomi Fish  committed 8fbe4b7

Add += and ~=.

  • Participants
  • Parent commits 66abeda

Comments (0)

Files changed (2)

File lurking-lisp-library/lurking.lisp

         `(defmacro ,op= (var . values)
             `(setf ,var (,',op ,var ,@values)))))
 
+(op2assign +)
 (op2assign -)
 (op2assign *)
 
 
 (defun ~ (&rest lst)
   (apply 'concatenate 'string lst))
+
+(op2assign ~)

File lurking-lisp-library/t/op-equal-sign.lisp

 
 (let ((producer (make-instance 'tap-producer)))
   (init-test producer)
-  (emit-plan producer :plan-argument 5) ; simple plan, three tests planned
+  (emit-plan producer :plan-argument 7) ; simple plan, three tests planned
   (let ((result 28))
     (-= result 4)
     ; TEST
     ; TEST
     (emit-result producer :success (= result 48) :description "Test *=")
 
+    (setf result 4)
+    (+= result 6)
+    ; TEST
+    (emit-result producer :success (= result 10) :description "Test +=")
+
     ; TEST
     (emit-result producer :success (equal (concat-uc "foo " "bar") "foo BAR")
                  :description "Testing concat-uc"))
   (emit-result producer :success (equal (~ "One" "Two" "Three") "OneTwoThree")
                :description "Testing the ~ function for string concatenation.")
 
+  (let ((string1 "Hello"))
+    ; TEST
+    (~= string1 "World")
+    (emit-result producer :success (equal string1 "HelloWorld")
+                 :description "Testing ~="))
+
   (finalize-test producer))