From 623dbc1acc3f214e2bb0cfdd2b82e6cd7c209645 Mon Sep 17 00:00:00 2001 From: Sebastian Pahnke Date: Fri, 5 Oct 2018 17:29:11 +0200 Subject: [PATCH] Add more tests for hex and binary integer literals --- src/javascript/javascript.test.ts | 21 +++++++++++++++++++++ src/typescript/typescript.test.ts | 21 +++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/src/javascript/javascript.test.ts b/src/javascript/javascript.test.ts index 889286aa..fd5236c4 100644 --- a/src/javascript/javascript.test.ts +++ b/src/javascript/javascript.test.ts @@ -375,6 +375,27 @@ testTokenization('javascript', [ ] }], + [{ + line: '0X123', + tokens: [ + { startIndex: 0, type: 'number.hex.js' } + ] + }], + + [{ + line: '0b101', + tokens: [ + { startIndex: 0, type: 'number.binary.js' } + ] + }], + + [{ + line: '0B101', + tokens: [ + { startIndex: 0, type: 'number.binary.js' } + ] + }], + // Regular Expressions [{ line: '//', diff --git a/src/typescript/typescript.test.ts b/src/typescript/typescript.test.ts index 795a4025..0154ae57 100644 --- a/src/typescript/typescript.test.ts +++ b/src/typescript/typescript.test.ts @@ -375,6 +375,27 @@ testTokenization('typescript', [ ] }], + [{ + line: '0X123', + tokens: [ + { startIndex: 0, type: 'number.hex.ts' } + ] + }], + + [{ + line: '0b101', + tokens: [ + { startIndex: 0, type: 'number.binary.ts' } + ] + }], + + [{ + line: '0B101', + tokens: [ + { startIndex: 0, type: 'number.binary.ts' } + ] + }], + // Regular Expressions [{ line: '//',