diff tests/test-check-code.t @ 18183:e1caaeb5a2ed

check-code: disallow defunct <> operator Added a test for that and one other python3 check in test-check-code.t.
author Augie Fackler <raf@durin42.com>
date Tue, 01 Jan 2013 13:05:22 -0600
parents c582a71457e5
children a91387a37f05
line wrap: on
line diff
--- a/tests/test-check-code.t	Tue Jan 01 13:04:40 2013 -0600
+++ b/tests/test-check-code.t	Tue Jan 01 13:05:22 2013 -0600
@@ -110,6 +110,18 @@
    > class empty():
    class foo() not available in Python 2.4, use class foo(object)
   [1]
+  $ cat > python3-compat.py << EOF
+  > foo <> bar
+  > reduce(lambda a, b: a + b, [1, 2, 3, 4])
+  > EOF
+  $ "$check_code" python3-compat.py
+  python3-compat.py:1:
+   > foo <> bar
+   <> operator is not available in Python 3+, use !=
+  python3-compat.py:2:
+   > reduce(lambda a, b: a + b, [1, 2, 3, 4])
+   reduce is not available in Python 3+
+  [1]
 
   $ cat > is-op.py <<EOF
   > # is-operator comparing number or string literal