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 4167 for branches


Ignore:
Timestamp:
2016-06-03T01:46:31-07:00 (9 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

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

    r4094 r4167  
    213213    (is (universal-equalp (left-contract term 1) term-contracted))))
    214214
     215(test sexp-conversion
     216  "Sexp conversion"
     217  (is (equal (->sexp (make-instance 'term :exponents '(0 0 0 0) :coeff -5) '(x y u v)) -5))
     218  (signals (error "Variables NIL and exponents #(0 0 0 0) must have the same length.")
     219    (->sexp (make-instance 'monom :exponents '(0 0 0 0))))
     220  (is (equal (->sexp (make-instance 'monom :exponents '(0 0 0 0)) '(x y u w)) 1))
     221  (is (equal (->sexp (make-instance 'monom :exponents '(0 0 1 0)) '(x y u w)) 'u))
     222  (is (equalp (->sexp (make-instance 'monom :exponents '(1 2 1 1)) '(x y u w))
     223              '(* X (EXPT Y 2) U W)))
     224  (is (equal (->sexp (make-instance 'term :exponents '(0 1 0 0) :coeff -5) '(x y u v))
     225             '(* -5 Y)))
     226  (is (equal (->sexp (make-instance 'term :exponents '(1 1 0 0) :coeff -5) '(x y u v))
     227             '(* -5 X Y)))
     228  (is (equal (->sexp (make-instance 'term :exponents '(1 0 0 0) :coeff -5) '(x y u v))
     229             '(* -5 X)))
     230  (is (equal (->sexp (make-instance 'term :exponents '(11 0 0 0) :coeff -5) '(x y u v))
     231             '(* -5 (EXPT X 11))))
     232  (is (equal (->sexp (make-instance 'term :exponents '(11 0 0 0) :coeff 5) '(x y u v))
     233             '(* 5 (EXPT X 11))))
     234  (is (equal (->sexp (make-instance 'term :exponents '(11 0 4 0) :coeff 5) '(x y u v))
     235             '(* 5 (EXPT X 11) (EXPT U 4))))
     236)
     237
    215238(run! 'monom-suite)
    216239(format t "All tests done!~%")
Note: See TracChangeset for help on using the changeset viewer.