Skip to content

Commit b2ae62d

Browse files
committed
test(fennel): cover workflow parity exports
1 parent 9d450a1 commit b2ae62d

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
local fennel = dofile("src/include/external/fennel/fennel.lua")
2+
local dseams = fennel.dofile("lua/dseams.fnl")
3+
4+
assert(type(dseams.rdf) == "function")
5+
assert(type(dseams["running-cn"]) == "function")
6+
assert(type(dseams.hbonds) == "function")
7+
assert(type(dseams.density) == "function")
8+
assert(type(dseams.pairs) == "function")
9+
assert(type(dseams.domain) == "function")
10+
11+
local cloud = dseams.read("input/traj/tiny-ions.lammpstrj", {all = true})
12+
local profile = dseams.density(cloud, {type = 1, bins = 2, axis = "z"})
13+
assert(#profile.centres == 2 and #profile.rho == 2)
14+
15+
local table = dseams["site-table"]("1=cationHead,2=anion")
16+
assert(dseams.pairs(cloud, {table = table}).count == 2)
17+
assert(dseams.domain(
18+
cloud,
19+
{table = table, kind = dseams.core.Kind.polar, cutoff = 1.5}
20+
).largest == 2)
21+
22+
print("dseams_fennel_workflows density=2 pairs=2 domain=2")

meson.build

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,4 +161,12 @@ if lua_exe.found()
161161
workdir: meson.project_source_root(),
162162
timeout: 120,
163163
)
164+
test(
165+
'dseams_fennel_workflows',
166+
lua_exe,
167+
args: [meson.project_source_root() / 'example_lua/library/fennel_workflows.lua'],
168+
env: lua_test_env,
169+
workdir: meson.project_source_root(),
170+
timeout: 120,
171+
)
164172
endif

0 commit comments

Comments
 (0)