From a343d6207859a70ed3ecddc8250fa84dc7438438 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Thu, 20 Sep 2018 18:26:57 +0200 Subject: [PATCH] Add example of trees for testing --- mapytex/calculus/core/test/__init__.py | 12 +++++++++++ mapytex/calculus/core/test/example_tree.py | 24 ++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 mapytex/calculus/core/test/__init__.py create mode 100644 mapytex/calculus/core/test/example_tree.py diff --git a/mapytex/calculus/core/test/__init__.py b/mapytex/calculus/core/test/__init__.py new file mode 100644 index 0000000..ae64758 --- /dev/null +++ b/mapytex/calculus/core/test/__init__.py @@ -0,0 +1,12 @@ +#! /usr/bin/env python +# -*- coding: utf-8 -*- +# vim:fenc=utf-8 +# +# Copyright © 2017 lafrite +# +# Distributed under terms of the MIT license. + +# ----------------------------- +# Reglages pour 'vim' +# vim:set autoindent expandtab tabstop=4 shiftwidth=4: +# cursor: 16 del diff --git a/mapytex/calculus/core/test/example_tree.py b/mapytex/calculus/core/test/example_tree.py new file mode 100644 index 0000000..3892d63 --- /dev/null +++ b/mapytex/calculus/core/test/example_tree.py @@ -0,0 +1,24 @@ +# vim:fenc=utf-8 +# +# Copyright © 2017 lafrite +# +# Distributed under terms of the MIT license. + +""" +Example of trees + +""" + +from ..tree import Tree + +simple_numeric = Tree.from_str("1+2*3") + +big_sum = Tree.from_str("1+2+3+4+5+6+7+8+9") +big_minus = Tree.from_str("1-2-3-4-5-6-7-8-9") +big_mult = Tree.from_str("1*2*3*4*5*6*7*8*9") +big_sum_of_times = Tree.from_str("1*2+3*4+5*6+7*8+9*10") + +# ----------------------------- +# Reglages pour 'vim' +# vim:set autoindent expandtab tabstop=4 shiftwidth=4: +# cursor: 16 del