Browse Source

tests/types1: Split out set type test to set_types.

set isn't the most basic type and can be disabled by a port.
pull/2554/merge
Paul Sokolovsky 8 years ago
parent
commit
e5a6a26330
  1. 16
      tests/basics/set_type.py
  2. 4
      tests/basics/types1.py

16
tests/basics/set_type.py

@ -0,0 +1,16 @@
# set type
# This doesn't really work as expected, because {None}
# leads SyntaxError during parsing.
try:
set
except NameError:
import sys
print("SKIP")
sys.exit()
print(set)
print(type(set()) == set)
print(type({None}) == set)

4
tests/basics/types1.py

@ -1,24 +1,22 @@
# basic types # basic types
# similar test for set type is done in set_type.py
print(bool) print(bool)
print(int) print(int)
print(tuple) print(tuple)
print(list) print(list)
print(set)
print(dict) print(dict)
print(type(bool()) == bool) print(type(bool()) == bool)
print(type(int()) == int) print(type(int()) == int)
print(type(tuple()) == tuple) print(type(tuple()) == tuple)
print(type(list()) == list) print(type(list()) == list)
print(type(set()) == set)
print(type(dict()) == dict) print(type(dict()) == dict)
print(type(False) == bool) print(type(False) == bool)
print(type(0) == int) print(type(0) == int)
print(type(()) == tuple) print(type(()) == tuple)
print(type([]) == list) print(type([]) == list)
print(type({None}) == set)
print(type({}) == dict) print(type({}) == dict)
try: try:

Loading…
Cancel
Save