[Groonga-commit] ranguba/rroonga at 5108b56 [master] test: fix test file

Back to archive index

Kouhei Sutou null+****@clear*****
Sat Apr 11 22:59:36 JST 2015


Kouhei Sutou	2015-04-11 22:59:36 +0900 (Sat, 11 Apr 2015)

  New Revision: 5108b56625a323bb07413bc9add5872f81ab151c
  https://github.com/ranguba/rroonga/commit/5108b56625a323bb07413bc9add5872f81ab151c

  Message:
    test: fix test file
    
    The tests are for regexp operator in expression context. They aren't in
    regexp operator context.

  Modified files:
    test/test-expression.rb
    test/test-operator.rb

  Modified: test/test-expression.rb (+37 -0)
===================================================================
--- test/test-expression.rb    2015-04-11 22:58:38 +0900 (b0ea3c7)
+++ test/test-expression.rb    2015-04-11 22:59:36 +0900 (8d29097)
@@ -264,6 +264,43 @@ class ExpressionTest < Test::Unit::TestCase
         INSPECTED
       end
     end
+
+    class RegexpTest < self
+      setup
+      def setup_expression
+        @expression = Groonga::Expression.new
+        @expression.append_constant("Alice")
+        @expression.append_constant(/\A[aA].*l/.source)
+      end
+
+      def test_constant
+        @expression.append_operation(Groonga::Operator::REGEXP, 2)
+        assert_equal(<<-INSPECTED.chomp, @expression.inspect)
+#<Groonga::Expression
+  vars:{
+  },
+  codes:{
+    0:<push n_args:1, flags:0, modify:2, value:"Alice">,
+    1:<push n_args:1, flags:0, modify:0, value:"\\\\A[aA].*l">,
+    2:<regexp n_args:2, flags:0, modify:0, value:(NULL)>
+  }>
+        INSPECTED
+      end
+
+      def test_name
+        @expression.append_operation("regexp", 2)
+        assert_equal(<<-INSPECTED.chomp, @expression.inspect)
+#<Groonga::Expression
+  vars:{
+  },
+  codes:{
+    0:<push n_args:1, flags:0, modify:2, value:"Alice">,
+    1:<push n_args:1, flags:0, modify:0, value:"\\\\A[aA].*l">,
+    2:<regexp n_args:2, flags:0, modify:0, value:(NULL)>
+  }>
+        INSPECTED
+      end
+    end
   end
 
   class VariableTest < self

  Modified: test/test-operator.rb (+0 -36)
===================================================================
--- test/test-operator.rb    2015-04-11 22:58:38 +0900 (c80fb65)
+++ test/test-operator.rb    2015-04-11 22:59:36 +0900 (e86869c)
@@ -20,40 +20,4 @@ class OperatorTest < Test::Unit::TestCase
 
   setup :setup_database
 
-  class RegexpTest < self
-    setup
-    def setup_expression
-      @expression = Groonga::Expression.new
-      @expression.append_constant("Alice")
-      @expression.append_constant(/\A[aA].*l/.source)
-    end
-
-    def test_constant
-      @expression.append_operation(Groonga::Operator::REGEXP, 2)
-      assert_equal(<<-INSPECTED.chomp, @expression.inspect)
-#<Groonga::Expression
-  vars:{
-  },
-  codes:{
-    0:<push n_args:1, flags:0, modify:2, value:"Alice">,
-    1:<push n_args:1, flags:0, modify:0, value:"\\\\A[aA].*l">,
-    2:<regexp n_args:2, flags:0, modify:0, value:(NULL)>
-  }>
-      INSPECTED
-    end
-
-    def test_name
-      @expression.append_operation("regexp", 2)
-      assert_equal(<<-INSPECTED.chomp, @expression.inspect)
-#<Groonga::Expression
-  vars:{
-  },
-  codes:{
-    0:<push n_args:1, flags:0, modify:2, value:"Alice">,
-    1:<push n_args:1, flags:0, modify:0, value:"\\\\A[aA].*l">,
-    2:<regexp n_args:2, flags:0, modify:0, value:(NULL)>
-  }>
-      INSPECTED
-    end
-  end
 end
-------------- next part --------------
HTML����������������������������...
Télécharger 



More information about the Groonga-commit mailing list
Back to archive index