null+****@clear*****
null+****@clear*****
2012年 7月 18日 (水) 20:48:05 JST
SHIMODA Hiroshi 2012-07-18 20:48:05 +0900 (Wed, 18 Jul 2012) New Revision: 8c29749ae7ce7548235d3e429452c0f992c5a453 https://github.com/groonga/gcs/commit/8c29749ae7ce7548235d3e429452c0f992c5a453 Log: Fix expected patterns for IndexDocuments response Modified files: test/api-configuration.test.js Modified: test/api-configuration.test.js (+16 -7) =================================================================== --- test/api-configuration.test.js 2012-07-18 20:43:39 +0900 (63db63e) +++ test/api-configuration.test.js 2012-07-18 20:48:05 +0900 (547555d) @@ -134,9 +134,13 @@ function PATTERN_IndexDocumentsResponse(members) { IndexDocumentsResponse: { '@': { xmlns: '' }, IndexDocumentsResult: { - FieldNames: members.map(function(member) { - return { member: '' }; - }) + FieldNames: (function() { + var pattern = {}; + members.forEach(function(member, index) { + pattern[index] = { member: '' }; + }); + return pattern; + })() }, ResponseMetadata: PATTERN_ResponseMetadata } @@ -578,10 +582,15 @@ suite('Configuration API', function() { body: PATTERN_IndexDocumentsResponse(expectedFieldNames) }); var fieldNames = response.body.IndexDocumentsResponse .IndexDocumentsResult - .FieldNames - .map(function(member) { - return member.member; - }); + .FieldNames; + fieldNames = (function() { + var names = []; + for (var i in fieldNames) { + if (fieldNames.hasOwnProperty(i)) + names.push(fieldNames[i].member); + } + return names; + })(); assert.deepEqual(fieldNames, expectedFieldNames); done(); -------------- next part -------------- HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B... Descargar