Skip to content

Commit 3d1af10

Browse files
committed
add some tests
1 parent 5c702c4 commit 3d1af10

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "PDBTools"
22
uuid = "e29189f1-7114-4dbd-93d0-c5673a921a58"
33
authors = ["Leandro Martinez <[email protected]>"]
4-
version = "2.6.1-DEV"
4+
version = "2.7.0-DEV"
55

66
[deps]
77
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"

src/read_write/write_pdb.jl

+10
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,16 @@ end
7373
f1 = readdlm(PDBTools.SMALLPDB, '\n', header=true)
7474
f2 = readdlm(tmpfile, '\n', header=true)
7575
@test f1[1] == f2[1]
76+
# test selection
77+
write_pdb(tmpfile, pdb, "name CA")
78+
f3 = read_pdb(tmpfile)
79+
@test length(f3) == 3
80+
# test header and footer
81+
write_pdb(tmpfile, pdb, "name CA"; header="HEADER test", footer="END test")
82+
s = split(String(read(tmpfile)))
83+
@test (s[begin],s[begin+1]) == ("HEADER", "test")
84+
@test (s[end-1],s[end]) == ("END", "test")
85+
# test append
7686
append_pdb = tempname() * ".pdb"
7787
write_pdb(append_pdb, pdb; append=true)
7888
pdb1 = read_pdb(append_pdb)

0 commit comments

Comments
 (0)