Browse Source

added number-parser spec

Alexander Rose 5 years ago
parent
commit
153f039ee6
1 changed files with 17 additions and 0 deletions
  1. 17 0
      src/mol-io/reader/_spec/common.spec.ts

+ 17 - 0
src/mol-io/reader/_spec/common.spec.ts

@@ -0,0 +1,17 @@
+/**
+ * Copyright (c) 2019 mol* contributors, licensed under MIT, See LICENSE file for more info.
+ *
+ * @author Alexander Rose <alexander.rose@weirdbyte.de>
+ */
+
+import { parseFloat as fastParseFloat, parseInt as fastParseInt } from '../../../mol-io/reader/common/text/number-parser';
+
+describe('common', () => {
+    it('number-parser fastParseFloat', () => {
+        expect(fastParseFloat('11.0829(23)', 0, 11)).toBe(11.0829)
+    });
+
+    it('number-parser fastParseInt', () => {
+        expect(fastParseInt('11(23)', 0, 11)).toBe(11)
+    });
+});