close Warning: Can't synchronize with repository "(default)" (The repository directory has changed, you should resynchronize the repository with: trac-admin $ENV repository resync '(default)'). Look in the Trac log for more information.

Changeset 4448 for branches/f4grobner


Ignore:
Timestamp:
2016-06-11T13:13:22-07:00 (9 years ago)
Author:
Marek Rychlik
Message:

Summary: Added auto-wrapping tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/5am-monom.lisp

    r4355 r4448  
    229229)
    230230
     231(test term-auto-wrapping-when-created
     232  "Term auto-wrapping upon creation"
     233  (let ((term-with-integer-coeff (make-instance 'term :dimension 3 :coeff 7))
     234        (term-with-rational-coeff (make-instance 'term :dimension 3 :coeff 3/5)))
     235    (is (eq (class-of (term-coeff term-with-integer-coeff)) (find-class 'integer-ring)))
     236    (is (eq (class-of (term-coeff term-with-rational-coeff)) (find-class 'rational-field)))))
     237
     238(test term-auto-wrapping-when-assigned
     239  "Term auto-wrapping upon assignment"
     240  (let ((term-with-null-coeff (make-instance 'term :dimension 3 :coeff nil)))
     241    (setf (term-coeff term-with-null-coeff) 7)
     242    (is (eq (class-of (term-coeff term-with-null-coeff)) (find-class 'integer-ring)))))
     243
     244
     245
    231246(run! 'monom-suite)
    232247(format t "All tests done!~%")
Note: See TracChangeset for help on using the changeset viewer.