[Groonga-commit] groonga/gcs [master] Add test for --print-synonyms

Back to archive index

null+****@clear***** null+****@clear*****
2012年 8月 9日 (木) 16:08:16 JST


SHIMODA Hiroshi	2012-08-09 16:08:16 +0900 (Thu, 09 Aug 2012)

  New Revision: 75175f2b5d935549954f6fc0aa6d331721d5ba76
  https://github.com/groonga/gcs/commit/75175f2b5d935549954f6fc0aa6d331721d5ba76

  Log:
    Add test for --print-synonyms

  Modified files:
    test/gcs-commands.test.js

  Modified: test/gcs-commands.test.js (+27 -3)
===================================================================
--- test/gcs-commands.test.js    2012-08-09 16:05:26 +0900 (fc2d4fc)
+++ test/gcs-commands.test.js    2012-08-09 16:08:16 +0900 (d3813a8)
@@ -425,10 +425,8 @@ suite('gcs-configure-text-options', function() {
   teardown(commonTeardown);
 
   test('load synonyms', function() {
+    new Domain('companies', context).createSync();
     utils
-      .run('gcs-create-domain',
-           '--domain-name', 'companies',
-           '--database-path', temporaryDatabase.path)
       .run('gcs-configure-text-options',
            '--domain-name', 'companies',
            '--synonyms', path.join(__dirname, 'fixtures', 'synonyms.txt'),
@@ -445,6 +443,32 @@ suite('gcs-configure-text-options', function() {
         done(e);
       });
   });
+
+  test('print synonyms', function() {
+    var domain = new Domain('companies', context);
+    domain.createSync();
+    domain.updateSynonymsSync({
+      hokkaido: 'dekkaido',
+      tokyo: ['tonkin', 'tokio']
+    });
+    utils
+      .run('gcs-configure-text-options',
+           '--domain-name', 'companies',
+           '--print-synonyms',
+           '--database-path', temporaryDatabase.path)
+      .next(function(result) {
+        assert.deepEqual({ code:    result.code,
+                           message: result.output.stdout },
+                         { code:    0,
+                           message: 'hokkaido,dekkaido\n' +
+                                    'tokyo,tokio,tonkin\n' },
+                         result.output.stderr);
+        done();
+      })
+      .error(function(e) {
+        done(e);
+      });
+  });
 });
 
 suite('gcs-index-documents', function() {
-------------- next part --------------
HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...
Télécharger 



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