t058.py

00001 # This file is Copyright 2003, 2006, 2007, 2009 Dean Hall.
00002 #
00003 # This file is part of the Python-on-a-Chip program.
00004 # Python-on-a-Chip is free software: you can redistribute it and/or modify
00005 # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
00006 #
00007 # Python-on-a-Chip is distributed in the hope that it will be useful,
00008 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00010 # A copy of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1
00011 # is seen in the file COPYING up one directory from this.
00012 
00013 #
00014 # System Test 058
00015 # Tests implementation of keyword "in" for Tuple, List and String
00016 #
00017 
00018 
00019 t = (2,5,6)
00020 assert 2 in t
00021 assert 5 in t
00022 assert 6 in t
00023 assert 8 not in t
00024 assert "c" not in t
00025 
00026 l = [2,5,6]
00027 assert 2 in l
00028 assert 5 in l
00029 assert 6 in l
00030 assert 8 not in l
00031 assert "c" not in l
00032 
00033 s = "256"
00034 assert "2" in s
00035 assert "5" in s
00036 assert "6" in s
00037 assert "8" not in s
00038 assert "c" not in s
00039 
00040 d = {2:2, 5:"5", 6:None}
00041 assert 2 in d
00042 assert 5 in d
00043 assert 6 in d
00044 assert 8 not in d
00045 assert "5" not in d
00046 assert "c" not in d

Generated on Mon Oct 18 07:40:47 2010 for Python-on-a-chip by  doxygen 1.5.9