[Groonga-commit] groonga/groonga [master] add a test for parsing float literal in string. #612

Back to archive index

null+****@clear***** null+****@clear*****
2010年 10月 15日 (金) 09:43:58 JST


Kouhei Sutou	2010-10-15 00:43:58 +0000 (Fri, 15 Oct 2010)

  New Revision: 861d352e24516276be6ca32ee9388a99ac40117e

  Log:
    add a test for parsing float literal in string. #612

  Modified files:
    test/unit/core/test-command-select-query.c

  Modified: test/unit/core/test-command-select-query.c (+17 -0)
===================================================================
--- test/unit/core/test-command-select-query.c    2010-10-14 10:19:03 +0000 (96d17c0)
+++ test/unit/core/test-command-select-query.c    2010-10-15 00:43:58 +0000 (a0dbc3b)
@@ -24,6 +24,7 @@
 #include "../lib/grn-assertions.h"
 
 void test_int64_compare_over_int32(void);
+void test_int64_compare_float_literal(void);
 
 static gchar *tmp_directory;
 
@@ -92,3 +93,19 @@ test_int64_compare_over_int32(void)
        "[1,344494643000000]]]",
     send_command("select Integers --query int64:<=344494643000000"));
 }
+
+void
+test_int64_compare_float_literal(void)
+{
+  assert_send_command("table_create Integers TABLE_NO_KEY");
+  assert_send_command("column_create Integers int64 COLUMN_SCALAR Int64");
+  assert_send_command("load --table Integers\n"
+                      "[\n"
+                      "{\"int64\":344494643000000}\n"
+                      "]");
+  cut_assert_equal_string(
+      "[[[1],"
+       "[[\"_id\",\"UInt32\"],[\"int64\",\"Int64\"]],"
+       "[1,344494643000000]]]",
+    send_command("select Integers --query int64:<=3.44494643e14"));
+}




Groonga-commit メーリングリストの案内
Back to archive index