analyzer.from.test.js 702 B

123456789101112131415161718192021222324252627
  1. var Analyzer = require('../../../index').query.analyzer;
  2. var tokenize = require('../../support/tokenize');
  3. var assert = require('assert');
  4. describe('Analyzer ::', function() {
  5. describe('FROM statements', function() {
  6. it('should generate a valid group when FROM is used', function() {
  7. var tokens = tokenize({
  8. select: ['*'],
  9. from: 'books'
  10. });
  11. var result = Analyzer(tokens);
  12. assert.deepEqual(result, [
  13. [
  14. { type: 'IDENTIFIER', value: 'SELECT' },
  15. { type: 'VALUE', value: '*' }
  16. ],
  17. [
  18. { type: 'IDENTIFIER', value: 'FROM' },
  19. { type: 'VALUE', value: 'books' }
  20. ]
  21. ]);
  22. });
  23. });
  24. });