コード例 #1
0
ファイル: testSymbols.py プロジェクト: schwidom/pl-lisp
def testSymbols3():

 te.checkComplainAndAdjustExpected( 0)

 s1= Symbol( 's1')
 s2= Symbol( 's2')
 s3= Symbol( 's3')
 s4= Symbol( 's4')
 s5= Symbol( 's5')

 typeSymbol.symAdd( s2, [s1])
 typeSymbol.symAdd( s3, [s2])
 typeSymbol.symAdd( s4, [s3])
 typeSymbol.symAdd( s5, [s4])

 te.test( typeSymbolChk( s5, s1))

 typeSymbolNot.symAdd( s4, [s2])

 te.test( not typeSymbolChk( s5, s1))
 te.test( not typeSymbolChk( s5, s2))
 te.test( typeSymbolChk( s5, s3))
 te.test( typeSymbolChk( s5, s4))

 te.test( not typeSymbolChk( s4, s1))
 te.test( not typeSymbolChk( s4, s2))
 te.test( typeSymbolChk( s4, s3))

 te.test( typeSymbolChk( s3, s1))
 te.test( typeSymbolChk( s3, s2))

 te.test( typeSymbolChk( s2, s1))

 typeSymbol.symDel( s5)
 typeSymbol.symDel( s4)
 typeSymbol.symDel( s3)
 typeSymbol.symDel( s2)

 typeSymbolNot.symDel( s4)

 te.checkComplainAndAdjustExpected( 11)
コード例 #2
0
ファイル: testSymbols.py プロジェクト: schwidom/pl-lisp
def testSymbols1(): # 010407a6a37b49bfb9836e84236e5586
 
 te.checkComplainAndAdjustExpected( 0)

 s1= Symbol( 's1')
 s2= Symbol( 's2')
 s3= Symbol( 's3')
 s4= Symbol( 's4')

 te.test( not typeSymbolChk( s4, Symbol( 's4')))

 te.test( typeSymbolChk( s4, s4)) 
 te.test( typeSymbolChk( s1, s1))

 typeSymbol.symAdd( s2, [s1])
 typeSymbol.symAdd( s3, [s1])
 typeSymbol.symAdd( s4, [s2, s3])

 te.test( typeSymbolChk( s4, s3))
 te.test( typeSymbolChk( s4, s2))
 te.test( typeSymbolChk( s4, s1))
 te.test( typeSymbolChk( s3, s1))
 te.test( typeSymbolChk( s2, s1))

 typeSymbolNot.symAdd( s3, [s1])

 te.test( typeSymbolChk( s4, s3))
 te.test( typeSymbolChk( s4, s2))
 te.test( typeSymbolChk( s4, s1))
 te.test( not typeSymbolChk( s3, s1))
 te.test( typeSymbolChk( s2, s1))
 
 typeSymbolNot.symAdd( s2, [s1])

 te.test( typeSymbolChk( s4, s3))
 te.test( typeSymbolChk( s4, s2))
 te.test( not typeSymbolChk( s4, s1))
 te.test( not typeSymbolChk( s3, s1))
 te.test( not typeSymbolChk( s2, s1))
 
 typeSymbolNot.symAdd( s4, [s3,s2])

 te.test( not typeSymbolChk( s4, s3))
 te.test( not typeSymbolChk( s4, s2))
 te.test( not typeSymbolChk( s4, s1))
 te.test( not typeSymbolChk( s3, s1))
 te.test( not typeSymbolChk( s2, s1))

 typeSymbolNot.symDel( s3)

 te.test( not typeSymbolChk( s4, s3))
 te.test( not typeSymbolChk( s4, s2))
 te.test( not typeSymbolChk( s4, s1))
 te.test( typeSymbolChk( s3, s1))
 te.test( not typeSymbolChk( s2, s1))

 typeSymbolNot.symDel( s2)

 te.test( not typeSymbolChk( s4, s3))
 te.test( not typeSymbolChk( s4, s2))
 te.test( not typeSymbolChk( s4, s1))
 te.test( typeSymbolChk( s3, s1))
 te.test( typeSymbolChk( s2, s1))
 
 typeSymbolNot.symDel( s4)
 for i in ( s4, s3, s2):
  typeSymbol.symDel( i)


 te.checkComplainAndAdjustExpected( 33)