Browse Source

Fixed cif test

David Sehnal 7 years ago
parent
commit
25559611c6
2 changed files with 4 additions and 1 deletions
  1. 3 0
      src/reader/cif/data-model.ts
  2. 1 1
      src/reader/spec/cif.spec.ts

+ 3 - 0
src/reader/cif/data-model.ts

@@ -21,6 +21,9 @@ export interface Block {
 }
 
 export function Block(categories: { readonly [name: string]: Category }, header: string): Block {
+    if (Object.keys(categories).some(k => k[0] !== '_')) {
+        throw new Error(`Category names must start with '_'.`);
+    }
     return { header, categories };
 }
 

+ 1 - 1
src/reader/spec/cif.spec.ts

@@ -14,7 +14,7 @@ const intField = TextField({ data: columnData, indices: [0, 1, 1, 2, 2, 3], coun
 const strField = TextField({ data: columnData, indices: [3, 4, 4, 5, 5, 6], count: 3 }, 3);
 
 const testBlock = Data.Block({
-    'atoms': Data.Category(3, {
+    _atoms: Data.Category(3, {
         x: intField,
         name: strField
     })