diff --git a/test/usecases/verbatim/locals.mod b/test/usecases/verbatim/locals.mod new file mode 100644 index 000000000..c5fd8b29b --- /dev/null +++ b/test/usecases/verbatim/locals.mod @@ -0,0 +1,26 @@ +NEURON { + SUFFIX locals +} + +PARAMETER { + a = -1.0 +} + +FUNCTION get_a() { LOCAL a + a = 32.0 +VERBATIM + _lget_a = _la; +ENDVERBATIM +} + +FUNCTION get_b() { LOCAL a, b + a = -1.0 + b = 32.0 + { LOCAL a + a = 100.0 + b = b + a + VERBATIM + _lget_b = _lb; + ENDVERBATIM + } +} diff --git a/test/usecases/verbatim/test_locals.py b/test/usecases/verbatim/test_locals.py new file mode 100644 index 000000000..c89fc1277 --- /dev/null +++ b/test/usecases/verbatim/test_locals.py @@ -0,0 +1,12 @@ +from neuron import h, gui + +def test_locals(): + s = h.Section() + s.insert("locals") + + assert s(0.5).locals.get_a() == 32.0 + assert s(0.5).locals.get_b() == 132.0 + + +if __name__ == "__main__": + test_locals()