diff options
author | Matthias Andreas Benkard <matthias@benkard.de> | 2008-06-19 20:15:33 +0200 |
---|---|---|
committer | Matthias Andreas Benkard <matthias@benkard.de> | 2008-06-19 20:15:33 +0200 |
commit | d1503a4c0651018d6484a9780722a1969a6f5634 (patch) | |
tree | 60ccc5eb158a0fc00540bbaa1b84ed0201fbe451 | |
parent | bc49c6720e20a64dc8708e96df89b616c90e4ddf (diff) |
MLKLowLevelTests: Add -testTokens.
-rw-r--r-- | MLKLowLevelTests.m | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/MLKLowLevelTests.m b/MLKLowLevelTests.m index 3214f7c..7d78377 100644 --- a/MLKLowLevelTests.m +++ b/MLKLowLevelTests.m @@ -20,21 +20,37 @@ #include <Foundation/Foundation.h> #include "MLKCons.h" +#include "MLKDoubleFloat.h" #include "MLKDynamicContext.h" #include "MLKEnvironment.h" #include "MLKLinkedList.h" #include "MLKPackage.h" +#include "MLKRatio.h" +#include "MLKReader.h" #include "MLKReadtable.h" +#include "MLKSingleFloat.h" #include "MLKSymbol.h" @interface MLKLowLevelTests : NSObject <UKTest> @end +// static void MLKNSUncaughtExceptionHandler (NSException *exception) +// { +// NSLog (@"Caught unhandled exception.\nName:%@\nReason:%@", +// [exception name], +// [exception reason]); +// } + + @implementation MLKLowLevelTests -(id) initForTest { self = [super init]; + [MLKDynamicContext currentContext]; + + // NSSetUncaughtExceptionHandler (MLKNSUncaughtExceptionHandler); + return self; } @@ -100,6 +116,47 @@ return nil; } + +-(id) testTokens +{ + UKObjectKindOf ([MLKReader readFromString:@"a"], MLKSymbol); + UKObjectKindOf ([MLKReader readFromString:@"MULK"], MLKSymbol); + UKObjectKindOf ([MLKReader readFromString:@"+"], MLKSymbol); + UKObjectKindOf ([MLKReader readFromString:@"0AA0A"], MLKSymbol); + + UKObjectKindOf ([MLKReader readFromString:@"134651234"], MLKInteger); + UKObjectKindOf ([MLKReader readFromString:@"223555."], MLKInteger); + UKObjectKindOf ([MLKReader readFromString:@"-134651234"], MLKInteger); + UKObjectKindOf ([MLKReader readFromString:@"-223555."], MLKInteger); + UKObjectKindOf ([MLKReader readFromString:@"+134651234"], MLKInteger); + UKObjectKindOf ([MLKReader readFromString:@"+223555."], MLKInteger); + UKObjectKindOf ([MLKReader readFromString:@"-1."], MLKInteger); + UKObjectKindOf ([MLKReader readFromString:@"+2"], MLKInteger); + UKObjectKindOf ([MLKReader readFromString:@"3."], MLKInteger); + UKObjectKindOf ([MLKReader readFromString:@"3"], MLKInteger); + + UKObjectKindOf ([MLKReader readFromString:@"55/11"], MLKRatio); + UKObjectKindOf ([MLKReader readFromString:@"-55/11"], MLKRatio); + + UKObjectKindOf ([MLKReader readFromString:@"1234.5678e99"], MLKSingleFloat); + UKObjectKindOf ([MLKReader readFromString:@"-1234.5678e99"], MLKSingleFloat); + UKObjectKindOf ([MLKReader readFromString:@"+1234.5678e99"], MLKSingleFloat); + UKObjectKindOf ([MLKReader readFromString:@"1234.5678e-99"], MLKSingleFloat); + UKObjectKindOf ([MLKReader readFromString:@"1234.5678e+99"], MLKSingleFloat); + UKObjectKindOf ([MLKReader readFromString:@"-1234.5678e-99"], MLKSingleFloat); + UKObjectKindOf ([MLKReader readFromString:@"1234.5678"], MLKSingleFloat); + UKObjectKindOf ([MLKReader readFromString:@"-1234.5678"], MLKSingleFloat); + UKObjectKindOf ([MLKReader readFromString:@".5678"], MLKSingleFloat); + UKObjectKindOf ([MLKReader readFromString:@"-.5678"], MLKSingleFloat); + UKObjectKindOf ([MLKReader readFromString:@"+.5678"], MLKSingleFloat); + UKObjectKindOf ([MLKReader readFromString:@".5678e3"], MLKSingleFloat); + UKObjectKindOf ([MLKReader readFromString:@"-.5678e3"], MLKSingleFloat); + UKObjectKindOf ([MLKReader readFromString:@"+.5678e3"], MLKSingleFloat); + + return nil; +} + + -(id) testStuff { // UKPass(); UKFail(); |