tokenizer.skip.test.js 830 B

1234567891011121314151617181920212223242526
  1. var Tokenizer = require('../../../index').query.tokenizer;
  2. var assert = require('assert');
  3. describe('Tokenizer ::', function() {
  4. describe('SKIP statements', function() {
  5. it('should generate a valid token array when SKIP is used', function() {
  6. var result = Tokenizer({
  7. select: ['*'],
  8. from: 'users',
  9. skip: 10
  10. });
  11. assert.deepEqual(result, [
  12. { type: 'IDENTIFIER', value: 'SELECT' },
  13. { type: 'VALUE', value: '*' },
  14. { type: 'ENDIDENTIFIER', value: 'SELECT' },
  15. { type: 'IDENTIFIER', value: 'FROM' },
  16. { type: 'VALUE', value: 'users' },
  17. { type: 'ENDIDENTIFIER', value: 'FROM' },
  18. { type: 'IDENTIFIER', value: 'SKIP' },
  19. { type: 'VALUE', value: 10 },
  20. { type: 'ENDIDENTIFIER', value: 'SKIP' }
  21. ]);
  22. });
  23. });
  24. });