[Groonga-commit] groonga/gcs [master] Add test for validation of invalid index field type

アーカイブの一覧に戻る

YUKI Hiroshi null+****@clear*****
Fri Nov 16 16:01:56 JST 2012


YUKI Hiroshi	2012-11-16 16:01:56 +0900 (Fri, 16 Nov 2012)

  New Revision: 699972928b64383e48945211e2d7ed2045611685
  https://github.com/groonga/gcs/commit/699972928b64383e48945211e2d7ed2045611685

  Log:
    Add test for validation of invalid index field type

  Modified files:
    test/database-index-field.test.js

  Modified: test/database-index-field.test.js (+9 -0)
===================================================================
--- test/database-index-field.test.js    2012-11-16 16:01:39 +0900 (eb6dafa)
+++ test/database-index-field.test.js    2012-11-16 16:01:56 +0900 (6ce8e36)
@@ -94,6 +94,15 @@ suite('database', function() {
                IndexField.VALID_NAME_PATTERN);
     });
 
+    test('unknown type', function() {
+      var field = new IndexField('foo');
+      assert.throw(function() {
+        field.type = 'unknown';
+      }, '1 validation error detected: ' +
+           'Value \'unknown\' at \'%TYPE_FIELD%\' failed to satisfy constraint: ' +
+             'Member must satisfy enum value set: [text, literal, uint]');
+    });
+
     test('indexTableName', function() {
       var field = new IndexField('valid_123', domain);
       assert.equal(field.indexTableName,
-------------- next part --------------
HTML����������������������������...
ダウンロード 



More information about the Groonga-commit mailing list
アーカイブの一覧に戻る