mirror of
https://github.com/c3d/DB48X-on-DM42.git
synced 2024-09-29 17:37:43 +02:00
polynomials: Add tests for Euclidean division
Add a couple of tests for Euclidean division and remainder.
This commit is contained in:
parent
160cfbe2d1
commit
ca7a180984
1 changed files with 18 additions and 0 deletions
18
src/tests.cc
18
src/tests.cc
|
@ -7032,6 +7032,24 @@ void tests::polynomials()
|
|||
step("Adding back one fo the original variables")
|
||||
.test("'X'", ENTER, ADD)
|
||||
.expect("ⓅX");
|
||||
step("Multiplication of simple polynomials")
|
||||
.test(NOSHIFT, F1, "X-Y", ENTER, NOSHIFT, F1, "X+Y", ENTER, MUL)
|
||||
.expect("ⓅX↑2-Y↑2");
|
||||
step("Polynomial euclidean division")
|
||||
.test(NOSHIFT, F1, "X-Y", ENTER, DIV)
|
||||
.expect("ⓅX+Y");
|
||||
step("Polynomial exponentiation")
|
||||
.test("3", LSHIFT, B)
|
||||
.expect("ⓅX↑3+3·X↑2·Y+3·X·Y↑2+Y↑3");
|
||||
step("Polynomial division with remainder")
|
||||
.test(NOSHIFT, F1, "X-Y", ENTER, DIV)
|
||||
.expect("ⓅX↑2+4·X·Y+7·Y↑2");
|
||||
step("Polynomial remainder")
|
||||
.test(LSHIFT, M, "rem", ENTER)
|
||||
.expect("Ⓟ8·Y↑3");
|
||||
step("Checking result")
|
||||
.test(NOSHIFT, M, F1, "X-Y", ENTER, MUL, ADD)
|
||||
.expect("ⓅY↑3+X↑3+3·X↑2·Y+3·X·Y↑2");
|
||||
|
||||
step("Restore default rendering for polynomials")
|
||||
.test(CLEAR, "'PrefixPolynomialRender' purge", ENTER).noerror();
|
||||
|
|
Loading…
Reference in a new issue