/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ /* globals expect, it, describe, StringStream, Lexer */ 'use strict'; describe('parser', function() { describe('Lexer', function() { it('should stop parsing numbers at the end of stream', function() { var input = new StringStream('11.234'); var lexer = new Lexer(input); var result = lexer.getNumber(); expect(result).toEqual(11.234); }); it('should parse PostScript numbers', function() { var numbers = ['-.002', '34.5', '-3.62', '123.6e10', '1E-5', '-1.', '0.0', '123', '-98', '43445', '0', '+17']; for (var i=0, ii=numbers.length; i'); var lexer = new Lexer(input); var result = lexer.getHexString(); expect(result).toEqual('p!U"$2'); }); }); });