[Pkg-octave-commit] [SCM] octave-symbolic branch, master, updated. a718b53403d9f164f8c2a3df521385a01d28a11b
thomas-weber
thomas-weber at 416fae20-06d0-4450-9b69-c6c34d4b5f03
Mon Jan 3 03:41:11 UTC 2011
The following commit has been merged in the master branch:
commit 4539bc5824b408bd949464809a32b9f4746a06a1
Author: thomas-weber <thomas-weber at 416fae20-06d0-4450-9b69-c6c34d4b5f03>
Date: Sat Jan 24 16:21:44 2009 +0000
Add some tests
git-svn-id: https://octave.svn.sourceforge.net/svnroot/octave/trunk/octave-forge/main/symbolic@5541 416fae20-06d0-4450-9b69-c6c34d4b5f03
diff --git a/inst/findsym.m b/inst/findsym.m
index 3c2e361..0535d23 100644
--- a/inst/findsym.m
+++ b/inst/findsym.m
@@ -82,3 +82,12 @@ else
endfor
endif
+% test the example
+%!test
+%! symbols
+%! x=sym("x"); y=sym("y"); f=x^2+3*x*y-y^2;
+%! vars = findsym (f);
+%! assert(vars, 'x,y');
+%! vars2 = findsym (f,1);
+%! assert(vars2, 'x');
+
diff --git a/inst/sym2poly.m b/inst/sym2poly.m
index 18169fe..840baf3 100644
--- a/inst/sym2poly.m
+++ b/inst/sym2poly.m
@@ -28,7 +28,7 @@
## @example
## symbols
## x=sym("x"); y=sym("y");
-## c = sym2poly (x^2+3*x-4); # c = [2,3,-4]
+## c = sym2poly (x^2+3*x-4); # c = [1,3,-4]
## c = sym2poly (x^2+y*x,x); # c = list(2,y,0)
## @end example
##
@@ -145,3 +145,11 @@ if all_numeric
else
c = c_ex;
endif
+
+% test examples
+%!test
+%! symbols
+%! x=sym("x"); y=sym("y");
+%! c = sym2poly (x^2+3*x-4);
+%! assert(c, [1,3,-4]);
+
--
octave-symbolic
More information about the Pkg-octave-commit
mailing list