Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Molstar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michal Malý
Molstar
Commits
78c7664b
Commit
78c7664b
authored
5 years ago
by
Alexander Rose
Browse files
Options
Downloads
Patches
Plain Diff
very basic ccp4 spec test
parent
39b29fe0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/mol-io/reader/_spec/ccp4.spec.ts
+25
-7
25 additions, 7 deletions
src/mol-io/reader/_spec/ccp4.spec.ts
src/mol-io/reader/_spec/dcd.spec.ts
+0
-1
0 additions, 1 deletion
src/mol-io/reader/_spec/dcd.spec.ts
with
25 additions
and
8 deletions
src/mol-io/reader/_spec/ccp4.spec.ts
+
25
−
7
View file @
78c7664b
...
...
@@ -6,19 +6,37 @@
import
*
as
CCP4
from
'
../ccp4/parser
'
const
ccp4Buffer
=
new
Uint8Array
(
4
*
64
)
function
createCcp4Data
()
{
const
data
=
new
Uint8Array
(
4
*
256
+
6
)
const
dv
=
new
DataView
(
data
.
buffer
)
dv
.
setInt8
(
52
*
4
,
'
M
'
.
charCodeAt
(
0
))
dv
.
setInt8
(
52
*
4
+
1
,
'
A
'
.
charCodeAt
(
0
))
dv
.
setInt8
(
52
*
4
+
2
,
'
P
'
.
charCodeAt
(
0
))
dv
.
setInt8
(
52
*
4
+
3
,
'
'
.
charCodeAt
(
0
))
dv
.
setInt32
(
0
*
4
,
1
)
// NC
dv
.
setInt32
(
1
*
4
,
2
)
// NR
dv
.
setInt32
(
2
*
4
,
3
)
// NS
return
data
}
describe
(
'
ccp4 reader
'
,
()
=>
{
it
(
'
basic
'
,
async
()
=>
{
const
parsed
=
await
CCP4
.
parse
(
ccp4Buffer
).
run
();
const
data
=
createCcp4Data
()
const
parsed
=
await
CCP4
.
parse
(
data
).
run
();
if
(
parsed
.
isError
)
{
console
.
log
(
parsed
)
return
;
throw
new
Error
(
parsed
.
message
)
}
// const ccp4File = parsed.result;
// const { header, values } = ccp4File;
// TODO
const
ccp4File
=
parsed
.
result
;
const
{
header
}
=
ccp4File
;
expect
(
header
.
NC
).
toBe
(
1
)
expect
(
header
.
NR
).
toBe
(
2
)
expect
(
header
.
NS
).
toBe
(
3
)
});
});
This diff is collapsed.
Click to expand it.
src/mol-io/reader/_spec/dcd.spec.ts
+
0
−
1
View file @
78c7664b
...
...
@@ -10,7 +10,6 @@ function createDcdData() {
const
data
=
new
Uint8Array
(
4
*
128
)
const
dv
=
new
DataView
(
data
.
buffer
)
// const intView = new Int32Array(data.buffer, 0, 23)
// set little endian
dv
.
setInt32
(
0
,
84
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment