summaryrefslogtreecommitdiff
path: root/tests/unit_tests
diff options
context:
space:
mode:
authorsimon2009-07-16 13:54:20 +0000
committersimon2009-07-16 13:54:20 +0000
commit8d7e5d22fb04cca474525fda7668227d8ad02687 (patch)
treeebf68ab2fd6213fd927c6292c08bd9dc360b5594 /tests/unit_tests
parent404fe6d0c2f7ddc158d8d14a0974ed94287ff9da (diff)
downloadscilab2c-8d7e5d22fb04cca474525fda7668227d8ad02687.tar.gz
scilab2c-8d7e5d22fb04cca474525fda7668227d8ad02687.tar.bz2
scilab2c-8d7e5d22fb04cca474525fda7668227d8ad02687.zip
added test for length and type functions
Diffstat (limited to 'tests/unit_tests')
-rw-r--r--tests/unit_tests/test_double_Length.sci32
-rw-r--r--tests/unit_tests/test_double_Type.sci8
2 files changed, 40 insertions, 0 deletions
diff --git a/tests/unit_tests/test_double_Length.sci b/tests/unit_tests/test_double_Length.sci
new file mode 100644
index 00000000..8e8a8c52
--- /dev/null
+++ b/tests/unit_tests/test_double_Length.sci
@@ -0,0 +1,32 @@
+function test_double_Length()
+ disp(length(4));
+ disp(length(2+3*%i));
+ disp(length([1 2 3 ; 4 5 6]));
+ disp(length([1 2 3 ; 4 5 6]*%i));
+ e = %pi ;
+ disp(length(e)); // d0Lengthd0
+
+ f = e * %i;
+ disp(length(f));// z0Lengthd0
+
+ a = [1 2 3 ; 4 5 6];
+ disp(length(a));// d2Lengthd0
+
+ b = [1 2 3 ; 4 5 6] * %i;
+ disp(length(b));// z2Lengthd0
+
+
+ g = "pouet" ;
+ h = "a" ;
+
+ disp(length(g)); // g0Lengthd0
+ disp(length(h)); // g2Lengthd0
+
+ disp(length("pouet"));
+ disp(length("a"));
+
+
+
+
+
+endfunction
diff --git a/tests/unit_tests/test_double_Type.sci b/tests/unit_tests/test_double_Type.sci
new file mode 100644
index 00000000..4585c65d
--- /dev/null
+++ b/tests/unit_tests/test_double_Type.sci
@@ -0,0 +1,8 @@
+function test_double_Type()
+
+ disp(type(%pi));
+ disp(type(%pi + %i));
+ disp(type([%pi 4]));
+ disp(type([%pi %i]));
+
+endfunction