From 8d7e5d22fb04cca474525fda7668227d8ad02687 Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 16 Jul 2009 13:54:20 +0000 Subject: added test for length and type functions --- tests/unit_tests/test_double_Length.sci | 32 ++++++++++++++++++++++++++++++++ tests/unit_tests/test_double_Type.sci | 8 ++++++++ 2 files changed, 40 insertions(+) create mode 100644 tests/unit_tests/test_double_Length.sci create mode 100644 tests/unit_tests/test_double_Type.sci (limited to 'tests/unit_tests') 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 -- cgit