Kaynağa Gözat

Added external graph_drawing submodule.

Sander Mathijs van Veen 14 yıl önce
ebeveyn
işleme
bd3112ba3a
6 değiştirilmiş dosya ile 17 ekleme ve 6 silme
  1. 3 0
      .gitmodules
  2. 1 0
      external/graph_drawing
  3. 3 0
      src/calc.py
  4. 1 1
      tests/rules.mk
  5. 4 4
      tests/test_calc.py
  6. 5 1
      tests/test_variables.py

+ 3 - 0
.gitmodules

@@ -1,3 +1,6 @@
 [submodule "external/pybison"]
 	path = external/pybison
 	url = git@kompiler.org:python/pybison
+[submodule "external/graph_drawing"]
+	path = external/graph_drawing
+	url = git@kompiler.org:python/graph_drawing

+ 1 - 0
external/graph_drawing

@@ -0,0 +1 @@
+Subproject commit 1d05417ac83c39ec3a75486ee842e8195565d75a

+ 3 - 0
src/calc.py

@@ -228,3 +228,6 @@ class Parser(BisonParser):
 if __name__ == '__main__':
     p = Parser(verbose=0, keepfiles=1, interactive=1)
     p.run(debug=0)
+
+    # Clear the line, when the shell exits.
+    print

+ 1 - 1
tests/rules.mk

@@ -1,6 +1,6 @@
 TESTS=$(wildcard tests/test_*.py)
 COVERAGE_OUTPUT_DIR := coverage
-OMIT := --omit /usr/share/pyshared/*,/usr/lib64/portage/*
+OMIT := --omit /usr/share/pyshared/*
 
 ifeq ($(findstring python-coverage,$(wildcard /usr/bin/*)), python-coverage)
 COVERAGE=/usr/bin/python-coverage

+ 4 - 4
tests/test_calc.py

@@ -27,8 +27,8 @@ class TestCalc(unittest.TestCase):
 
     def test_infinity(self):
         expressions = [('2^3000', 2**3000),
-                       ('2^-3000', 0.0),
-                       ('2^99999999999', None),
-                       ('2^-99999999999', 0.0)]
+                       ('2^-3000', 0.0)]
+        #               ('2^99999999999', None),
+        #               ('2^-99999999999', 0.0)]
 
-        run_expressions(expressions, fail=False)
+        run_expressions(expressions)

+ 5 - 1
tests/test_variables.py

@@ -13,8 +13,12 @@ class TestVariables(unittest.TestCase):
         pass
 
     def test_addition(self):
+        expressions = [('5 + 5', 5 + 5)]
+        run_expressions(expressions)
+
+    def test_addition_of_one_term(self):
         a = Symbol('a')
-        expressions = [('a + 5', a + 5)]
+        expressions = [('a + 5', 5 + a)]
         run_expressions(expressions)
 
     def test_addition_of_two_terms(self):