From 25559611c638326011b29afa83ee9bceb9f017f7 Mon Sep 17 00:00:00 2001
From: David Sehnal <david.sehnal@gmail.com>
Date: Tue, 3 Oct 2017 14:28:28 +0200
Subject: [PATCH] Fixed cif test

---
 src/reader/cif/data-model.ts | 3 +++
 src/reader/spec/cif.spec.ts  | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/reader/cif/data-model.ts b/src/reader/cif/data-model.ts
index 4033df03a..a28af149d 100644
--- a/src/reader/cif/data-model.ts
+++ b/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 };
 }
 
diff --git a/src/reader/spec/cif.spec.ts b/src/reader/spec/cif.spec.ts
index 87950cf64..8a9cf8277 100644
--- a/src/reader/spec/cif.spec.ts
+++ b/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
     })
-- 
GitLab