浏览代码

Fixed tests for HexadecimalIdentifierNamesGenerator

sanex3339 5 年之前
父节点
当前提交
0a57798b8a

+ 4 - 4
test/unit-tests/generators/identifier-names-generators/HexadecimalIdentifierNamesGenerator.spec.ts

@@ -28,7 +28,7 @@ describe('HexadecimalIdentifierNamesGenerator', () => {
                 );
 
                 hexadecimalIdentifierName = identifierNamesGenerator.generateNext();
-                regExp = /^_0x(\w){6}$/;
+                regExp = /^_0x(\w){4,6}$/;
             });
 
             it('should return hexadecimal name', () => {
@@ -50,8 +50,8 @@ describe('HexadecimalIdentifierNamesGenerator', () => {
                     IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator
                 );
 
-                hexadecimalIdentifierName = identifierNamesGenerator.generateNext(4);
-                regExp = /^_0x(\w){4}$/;
+                hexadecimalIdentifierName = identifierNamesGenerator.generateNext(3);
+                regExp = /^_0x(\w){3}$/;
             });
 
             it('should return hexadecimal name', () => {
@@ -61,7 +61,7 @@ describe('HexadecimalIdentifierNamesGenerator', () => {
     });
 
     describe('generateForGlobalScope', () => {
-        const regExp: RegExp = /^foo_0x(\w){6}$/;
+        const regExp: RegExp = /^foo_0x(\w){4,6}$/;
 
         let identifierNamesGenerator: IIdentifierNamesGenerator,
             hexadecimalIdentifierName: string;