Explorar o código

added number-parser spec

Alexander Rose %!s(int64=5) %!d(string=hai) anos
pai
achega
153f039ee6
Modificáronse 1 ficheiros con 17 adicións e 0 borrados
  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)
+    });
+});