projects
/
linpy.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Check symbol names
[linpy.git]
/
linpy
/
tests
/
test_linexprs.py
diff --git
a/linpy/tests/test_linexprs.py
b/linpy/tests/test_linexprs.py
index
fb7e4a2
..
9599d06
100644
(file)
--- a/
linpy/tests/test_linexprs.py
+++ b/
linpy/tests/test_linexprs.py
@@
-214,11
+214,20
@@
class TestSymbol(unittest.TestCase):
self.y = Symbol('y')
def test_new(self):
self.y = Symbol('y')
def test_new(self):
- self.assertEqual(Symbol('
x
'), self.x)
+ self.assertEqual(Symbol('
x
'), self.x)
with self.assertRaises(TypeError):
Symbol(self.x)
with self.assertRaises(TypeError):
Symbol(1)
with self.assertRaises(TypeError):
Symbol(self.x)
with self.assertRaises(TypeError):
Symbol(1)
+ with self.assertRaises(SyntaxError):
+ Symbol('1')
+ with self.assertRaises(SyntaxError):
+ Symbol('x.1')
+ with self.assertRaises(SyntaxError):
+ Symbol('x 1')
+ Symbol('_')
+ Symbol('_x')
+ Symbol('x_1')
def test_name(self):
self.assertEqual(self.x.name, 'x')
def test_name(self):
self.assertEqual(self.x.name, 'x')