Skip to content

Commit 1c02f14

Browse files
committed
Add tests
1 parent 5cacc2f commit 1c02f14

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

tests/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ set(RTESTS
6464
integrals
6565
display
6666
dummies
67+
explicit_implicit
6768
trigonometric
6869
noncovariant
6970
algebra

tests/explicit_implicit.cdb

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11

2-
{m,n,p}::Indices(spacetime, position=fixed);
3-
{a,b,c,d,e,f,g,h}::Indices(spinor, position=fixed);
4-
\sigma^{p}::ImplicitIndex(\sigma^{p a}_{b});
5-
\psi::ImplicitIndex(\psi_{a});
6-
\chi::ImplicitIndex(\chi_{a});
7-
\bpsi::ImplicitIndex(\bpsi^{a});
8-
\bchi::ImplicitIndex(\bchi^{a});
2+
def test01():
3+
__cdbkernel__=create_scope()
4+
{m,n,p}::Indices(spacetime, position=fixed);
5+
{a,b,c,d,e,f,g,h}::Indices(spinor, position=fixed);
6+
\sigma^{p}::ImplicitIndex(\sigma^{p a}_{b});
7+
\psi::ImplicitIndex(\psi_{a});
8+
\chi::ImplicitIndex(\chi^{a});
9+
ex:= \psi \sigma^{m} \sigma^{n} \chi \lambda^{a} + \lambda_{b} \chi^{b} T^{m n}\chi^{a};
10+
explicit_indices(_)
11+
tst:= \psi_{c} \sigma^{m c}_{d} \sigma^{n d}_{e} \chi^{e} \lambda^{a} + \lambda_{b} \chi^{b} T^{m n}\chi^{a} - @(ex);
12+
assert(tst==0)
13+
print("Test 01a passed")
14+
ex:= \psi \sigma^{m} \chi;
15+
explicit_indices(_)
16+
tst:= \psi_{a} \sigma^{m a}_{b} \chi^{b} - @(ex);
17+
assert(tst==0)
18+
print("Test 01b passed")
919

10-
11-
ex:= \psi \sigma^{m} \sigma^{n} \chi \lambda^{a} + \lambda_{b} \chi^{b} T^{m n}\chi^{a};
12-
explicit_indices(_);
13-
14-
ex:= \psi \sigma^{m} \chi + \chi \sigma^{m} \chi;
15-
explicit_indices(_);
20+
test01()
1621

0 commit comments

Comments
 (0)