Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

multi level group/items in working storage, test

  • Loading branch information...
commit e58b814ad6d6c233c3300dbc28b40ad5e86a77d0 1 parent 79c6b07
ajlopez authored

Showing 1 changed file with 30 additions and 0 deletions. Show diff stats Hide diff stats

  1. +30 0 test/ws.js
30 test/ws.js
@@ -52,3 +52,33 @@ assert.ok(program.data.working_storage);
52 52 assert.ok(typeof(program.data.working_storage.group1) != 'undefined');
53 53 assert.ok(typeof(program.data.working_storage.group1.items.item1) != 'undefined');
54 54 assert.ok(typeof(program.data.working_storage.group1.items.item2) != 'undefined');
  55 +
  56 +// Working storage with two group items and three levels
  57 +
  58 +var parser = new cobs.Parser('\
  59 +DATA DIVISION.\r\n\
  60 +WORKING-STORAGE SECTION.\r\n\
  61 +01 GROUP1.\r\n\
  62 +02 ITEM1.\r\n\
  63 +03 SUBITEM1.\r\n\
  64 +03 SUBITEM2.\r\n\
  65 +02 ITEM2.\r\n\
  66 +01 GROUP2.\r\n\
  67 +02 ITEM1.\r\n\
  68 +02 ITEM2.\r\n\
  69 + ');
  70 +
  71 +var program = parser.parseProgram();
  72 +
  73 +assert.ok(program);
  74 +assert.ok(program.data);
  75 +assert.ok(program.data.working_storage);
  76 +assert.ok(program.data.working_storage.group1);
  77 +assert.ok(program.data.working_storage.group1.items.item1);
  78 +assert.ok(program.data.working_storage.group1.items.item1.items);
  79 +assert.ok(typeof(program.data.working_storage.group1.items.item1.items.subitem1) != 'undefined');
  80 +assert.ok(typeof(program.data.working_storage.group1.items.item1.items.subitem2) != 'undefined');
  81 +assert.ok(typeof(program.data.working_storage.group1.items.item2) != 'undefined');
  82 +assert.ok(program.data.working_storage.group2);
  83 +assert.ok(typeof(program.data.working_storage.group2.items.item1) != 'undefined');
  84 +assert.ok(typeof(program.data.working_storage.group2.items.item2) != 'undefined');

0 comments on commit e58b814

Please sign in to comment.
Something went wrong with that request. Please try again.