Changeset: 33c5a3818f84 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=33c5a3818f84
Added Files:
        monetdb5/tests/gdkTests/Tests/between.mal
        monetdb5/tests/gdkTests/Tests/between.stable.err
        monetdb5/tests/gdkTests/Tests/between.stable.out
Modified Files:
        monetdb5/modules/mal/calc.mal
        monetdb5/modules/mal/calc.mal.sh
        monetdb5/tests/gdkTests/Tests/All
Branch: Jan2014
Log Message:

Enable calc.between and add some tests.


diffs (truncated from 564 to 300 lines):

diff --git a/monetdb5/modules/mal/calc.mal b/monetdb5/modules/mal/calc.mal
--- a/monetdb5/modules/mal/calc.mal
+++ b/monetdb5/modules/mal/calc.mal
@@ -4359,6 +4359,10 @@ address CMDvarCMP
 comment "Return -1/0/1 if V1 </==/> V2";
 
 
+pattern between(b:any_1,lo:any_1,hi:any_1) :bit
+address CMDvarBETWEEN
+comment "B between LO and HI inclusive, nil border is (minus) infinity";
+
 pattern void(v:void) :void
 address CMDvarCONVERT
 comment "Cast VALUE to void";
diff --git a/monetdb5/modules/mal/calc.mal.sh b/monetdb5/modules/mal/calc.mal.sh
--- a/monetdb5/modules/mal/calc.mal.sh
+++ b/monetdb5/modules/mal/calc.mal.sh
@@ -307,14 +307,12 @@ EOF
 done
 echo
 
-# for tp in $fixtypes; do
-#     cat <<EOF
-# pattern between(b:$tp,lo:$tp,hi:$tp) :bit
-# address CMDvarBETWEEN
-# comment "B between LO and HI inclusive, nil border is (minus) infinity";
+cat <<EOF
+pattern between(b:any_1,lo:any_1,hi:any_1) :bit
+address CMDvarBETWEEN
+comment "B between LO and HI inclusive, nil border is (minus) infinity";
 
-# EOF
-# done
+EOF
 
 for tp1 in void $alltypes; do
     for tp2 in void $alltypes; do
diff --git a/monetdb5/tests/gdkTests/Tests/All 
b/monetdb5/tests/gdkTests/Tests/All
--- a/monetdb5/tests/gdkTests/Tests/All
+++ b/monetdb5/tests/gdkTests/Tests/All
@@ -1,6 +1,7 @@
 append_dense_tail
 bat_replace
 bat_insert
+between
 binsemijoin2
 casts
 cross
diff --git a/monetdb5/tests/gdkTests/Tests/between.mal 
b/monetdb5/tests/gdkTests/Tests/between.mal
new file mode 100644
--- /dev/null
+++ b/monetdb5/tests/gdkTests/Tests/between.mal
@@ -0,0 +1,169 @@
+str1 := "alice";
+str2 := "bob";
+str3 := "carol";
+t := calc.between(str1,str1,str1);
+io.print("str1 between str1 and str1?");
+io.print(t);
+t := calc.between(str1,str1,str2);
+io.print("str1 between str1 and str2?");
+io.print(t);
+t := calc.between(str1,str1,str3);
+io.print("str1 between str1 and str3?");
+io.print(t);
+t := calc.between(str1,str2,str1);
+io.print("str1 between str2 and str1?");
+io.print(t);
+t := calc.between(str1,str2,str2);
+io.print("str1 between str2 and str2?");
+io.print(t);
+t := calc.between(str1,str2,str3);
+io.print("str1 between str2 and str3?");
+io.print(t);
+t := calc.between(str1,str3,str1);
+io.print("str1 between str3 and str1?");
+io.print(t);
+t := calc.between(str1,str3,str2);
+io.print("str1 between str3 and str2?");
+io.print(t);
+t := calc.between(str1,str3,str3);
+io.print("str1 between str3 and str3?");
+io.print(t);
+t := calc.between(str2,str1,str1);
+io.print("str2 between str1 and str1?");
+io.print(t);
+t := calc.between(str2,str1,str2);
+io.print("str2 between str1 and str2?");
+io.print(t);
+t := calc.between(str2,str1,str3);
+io.print("str2 between str1 and str3?");
+io.print(t);
+t := calc.between(str2,str2,str1);
+io.print("str2 between str2 and str1?");
+io.print(t);
+t := calc.between(str2,str2,str2);
+io.print("str2 between str2 and str2?");
+io.print(t);
+t := calc.between(str2,str2,str3);
+io.print("str2 between str2 and str3?");
+io.print(t);
+t := calc.between(str2,str3,str1);
+io.print("str2 between str3 and str1?");
+io.print(t);
+t := calc.between(str2,str3,str2);
+io.print("str2 between str3 and str2?");
+io.print(t);
+t := calc.between(str2,str3,str3);
+io.print("str2 between str3 and str3?");
+io.print(t);
+t := calc.between(str3,str1,str1);
+io.print("str3 between str1 and str1?");
+io.print(t);
+t := calc.between(str3,str1,str2);
+io.print("str3 between str1 and str2?");
+io.print(t);
+t := calc.between(str3,str1,str3);
+io.print("str3 between str1 and str3?");
+io.print(t);
+t := calc.between(str3,str2,str1);
+io.print("str3 between str2 and str1?");
+io.print(t);
+t := calc.between(str3,str2,str2);
+io.print("str3 between str2 and str2?");
+io.print(t);
+t := calc.between(str3,str2,str3);
+io.print("str3 between str2 and str3?");
+io.print(t);
+t := calc.between(str3,str3,str1);
+io.print("str3 between str3 and str1?");
+io.print(t);
+t := calc.between(str3,str3,str2);
+io.print("str3 between str3 and str2?");
+io.print(t);
+t := calc.between(str3,str3,str3);
+io.print("str3 between str3 and str3?");
+io.print(t);
+
+sht1 := -32767:sht;
+sht2 := 0:sht;
+sht3 := 32767:sht;
+t := calc.between(sht1,sht1,sht1);
+io.print("sht1 between sht1 and sht1?");
+io.print(t);
+t := calc.between(sht1,sht1,sht2);
+io.print("sht1 between sht1 and sht2?");
+io.print(t);
+t := calc.between(sht1,sht1,sht3);
+io.print("sht1 between sht1 and sht3?");
+io.print(t);
+t := calc.between(sht1,sht2,sht1);
+io.print("sht1 between sht2 and sht1?");
+io.print(t);
+t := calc.between(sht1,sht2,sht2);
+io.print("sht1 between sht2 and sht2?");
+io.print(t);
+t := calc.between(sht1,sht2,sht3);
+io.print("sht1 between sht2 and sht3?");
+io.print(t);
+t := calc.between(sht1,sht3,sht1);
+io.print("sht1 between sht3 and sht1?");
+io.print(t);
+t := calc.between(sht1,sht3,sht2);
+io.print("sht1 between sht3 and sht2?");
+io.print(t);
+t := calc.between(sht1,sht3,sht3);
+io.print("sht1 between sht3 and sht3?");
+io.print(t);
+t := calc.between(sht2,sht1,sht1);
+io.print("sht2 between sht1 and sht1?");
+io.print(t);
+t := calc.between(sht2,sht1,sht2);
+io.print("sht2 between sht1 and sht2?");
+io.print(t);
+t := calc.between(sht2,sht1,sht3);
+io.print("sht2 between sht1 and sht3?");
+io.print(t);
+t := calc.between(sht2,sht2,sht1);
+io.print("sht2 between sht2 and sht1?");
+io.print(t);
+t := calc.between(sht2,sht2,sht2);
+io.print("sht2 between sht2 and sht2?");
+io.print(t);
+t := calc.between(sht2,sht2,sht3);
+io.print("sht2 between sht2 and sht3?");
+io.print(t);
+t := calc.between(sht2,sht3,sht1);
+io.print("sht2 between sht3 and sht1?");
+io.print(t);
+t := calc.between(sht2,sht3,sht2);
+io.print("sht2 between sht3 and sht2?");
+io.print(t);
+t := calc.between(sht2,sht3,sht3);
+io.print("sht2 between sht3 and sht3?");
+io.print(t);
+t := calc.between(sht3,sht1,sht1);
+io.print("sht3 between sht1 and sht1?");
+io.print(t);
+t := calc.between(sht3,sht1,sht2);
+io.print("sht3 between sht1 and sht2?");
+io.print(t);
+t := calc.between(sht3,sht1,sht3);
+io.print("sht3 between sht1 and sht3?");
+io.print(t);
+t := calc.between(sht3,sht2,sht1);
+io.print("sht3 between sht2 and sht1?");
+io.print(t);
+t := calc.between(sht3,sht2,sht2);
+io.print("sht3 between sht2 and sht2?");
+io.print(t);
+t := calc.between(sht3,sht2,sht3);
+io.print("sht3 between sht2 and sht3?");
+io.print(t);
+t := calc.between(sht3,sht3,sht1);
+io.print("sht3 between sht3 and sht1?");
+io.print(t);
+t := calc.between(sht3,sht3,sht2);
+io.print("sht3 between sht3 and sht2?");
+io.print(t);
+t := calc.between(sht3,sht3,sht3);
+io.print("sht3 between sht3 and sht3?");
+io.print(t);
diff --git a/monetdb5/tests/gdkTests/Tests/between.stable.err 
b/monetdb5/tests/gdkTests/Tests/between.stable.err
new file mode 100644
--- /dev/null
+++ b/monetdb5/tests/gdkTests/Tests/between.stable.err
@@ -0,0 +1,29 @@
+stderr of test 'between` in directory 'monetdb5/tests/gdkTests` itself:
+
+
+# 10:10:08 >  
+# 10:10:08 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=36860" "--set" 
"mapi_usock=/var/tmp/mtest-11251/.s.monetdb.36860" "--set" "monet_prompt=" 
"--forcemito" "--set" "mal_listing=2" 
"--dbpath=/home/sjoerd/Monet-stable/var/MonetDB/mTests_monetdb5_tests_gdkTests" 
"between.mal"
+# 10:10:08 >  
+
+# builtin opt  gdk_dbpath = /home/sjoerd/Monet-stable/var/monetdb5/dbfarm/demo
+# builtin opt  gdk_debug = 0
+# builtin opt  gdk_vmtrim = no
+# builtin opt  monet_prompt = >
+# builtin opt  monet_daemon = no
+# builtin opt  mapi_port = 50000
+# builtin opt  mapi_open = false
+# builtin opt  mapi_autosense = false
+# builtin opt  sql_optimizer = default_pipe
+# builtin opt  sql_debug = 0
+# cmdline opt  gdk_nr_threads = 0
+# cmdline opt  mapi_open = true
+# cmdline opt  mapi_port = 36860
+# cmdline opt  mapi_usock = /var/tmp/mtest-11251/.s.monetdb.36860
+# cmdline opt  monet_prompt = 
+# cmdline opt  mal_listing = 2
+# cmdline opt  gdk_dbpath = 
/home/sjoerd/Monet-stable/var/MonetDB/mTests_monetdb5_tests_gdkTests
+
+# 10:10:08 >  
+# 10:10:08 >  "Done."
+# 10:10:08 >  
+
diff --git a/monetdb5/tests/gdkTests/Tests/between.stable.out 
b/monetdb5/tests/gdkTests/Tests/between.stable.out
new file mode 100644
--- /dev/null
+++ b/monetdb5/tests/gdkTests/Tests/between.stable.out
@@ -0,0 +1,303 @@
+stdout of test 'between` in directory 'monetdb5/tests/gdkTests` itself:
+
+
+# 10:10:08 >  
+# 10:10:08 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=36860" "--set" 
"mapi_usock=/var/tmp/mtest-11251/.s.monetdb.36860" "--set" "monet_prompt=" 
"--forcemito" "--set" "mal_listing=2" 
"--dbpath=/home/sjoerd/Monet-stable/var/MonetDB/mTests_monetdb5_tests_gdkTests" 
"between.mal"
+# 10:10:08 >  
+
+# MonetDB 5 server v11.17.22 (hg id: 64939b9031c6+)
+# This is an unreleased version
+# Serving database 'mTests_monetdb5_tests_gdkTests', using 8 threads
+# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically 
linked
+# Found 7.734 GiB available main-memory.
+# Copyright (c) 1993-July 2008 CWI.
+# Copyright (c) August 2008-2014 MonetDB B.V., all rights reserved
+# Visit http://www.monetdb.org/ for further information
+# Listening for connection requests on mapi:monetdb://gaai.mullender.nl:36860/
+# Listening for UNIX domain connection requests on 
mapi:monetdb:///var/tmp/mtest-11251/.s.monetdb.36860
+# MonetDB/GIS module loaded
+# MonetDB/JAQL module loaded
+# MonetDB/SQL module loaded
+function user.main():void;
+    str1 := "alice";
+    str2 := "bob";
+    str3 := "carol";
+    t := calc.between(str1,str1,str1);
+    io.print("str1 between str1 and str1?");
+    io.print(t);
+    t := calc.between(str1,str1,str2);
+    io.print("str1 between str1 and str2?");
+    io.print(t);
+    t := calc.between(str1,str1,str3);
+    io.print("str1 between str1 and str3?");
+    io.print(t);
+    t := calc.between(str1,str2,str1);
+    io.print("str1 between str2 and str1?");
+    io.print(t);
+    t := calc.between(str1,str2,str2);
+    io.print("str1 between str2 and str2?");
+    io.print(t);
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to