소스 검색

Add more tests for hex and binary integer literals

Sebastian Pahnke 6 년 전
부모
커밋
623dbc1acc
2개의 변경된 파일42개의 추가작업 그리고 0개의 파일을 삭제
  1. 21 0
      src/javascript/javascript.test.ts
  2. 21 0
      src/typescript/typescript.test.ts

+ 21 - 0
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: '//',

+ 21 - 0
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: '//',