com.cyc.tool.subl.jrtl.nativeCode.subLisp
Class UnitTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by com.cyc.tool.subl.jrtl.nativeCode.subLisp.UnitTest
All Implemented Interfaces:
CommonSymbols, junit.framework.Test

public class UnitTest
extends junit.framework.TestCase
implements CommonSymbols

This JUnit test file will test the functionality of the read-eval functionality used by SubLMain. Search for occurrences of @diff to see all C/Allegro/CMUCL/Java differences.

Copyright (c) 2004 - 2006 Cycorp, Inc. All rights reserved.
This software is the proprietary information of Cycorp, Inc.

Use is subject to license terms.

Version:
$Id: UnitTest.java 128954 2009-10-15 17:55:43Z tbrussea $
Author:
pace

Nested Class Summary
static class UnitTest.SubLFile_Test
           
 
Field Summary
static com.cyc.tool.subl.jrtl.nativeCode.subLisp.UnitTest.DivisionTest[] DIVISION_TEST_CASE_TABLE
           
 
Fields inherited from interface com.cyc.tool.subl.jrtl.nativeCode.subLisp.CommonSymbols
ANSWER_TAG, APPEND_KEYWORD, APPEND_STACK_TRACES_TO_ERROR_MESSAGES, AREF, ASSEMBLE_FIXNUMS_TO_INTEGER, ATOM, BIGNUMP, BINARY_KEYWORD, BINDING_TYPE, BOOLEANP, CAAR, CADR, CAND, CAR, CCATCH, CDEC, CDESTRUCTURING_BIND, CDO, CDO_ALL_SYMBOLS, CDO_EXTERNAL_SYMBOLS, CDO_SYMBOLS, CDOHASH, CDOLIST, CDOTIMES, CDR, CHAR, CHAR_E_SYMBOL, CHAR_EQUAL_SYMBOL, CHAR_GREATER_THAN_OR_EQUAL_SYMBOL, CHAR_GREATER_THAN_SYMBOL, CHAR_GT_SYMBOL, CHAR_GTE_SYMBOL, CHAR_LESS_THAN_OR_EQUAL_SYMBOL, CHAR_LESS_THAN_SYMBOL, CHAR_LT_SYMBOL, CHAR_LTE_SYMBOL, CHAR_NE_SYMBOL, CHAR_NOT_EQUAL_SYMBOL, CHARACTERP, CHECK_TYPE, CINC, CLET, CMULTIPLE_VALUE_BIND, CNOT, CONS, CONSP, CONSTANT, COR, CPOP, CPROGV, CPUSH, CPUSHNEW, CREATE_KEYWORD, CSETF, CSETQ, CSOME, CTIME, CUNWIND_PROTECT, CVS_ID, DEBUG_IO, DECLAIM, DECLARE, DEFCONSTANT, DEFINE, DEFLEXICAL, DEFMACRO, DEFPARAMETER, DEFVAR, DIRECTION_KEYWORD, DYNAMIC, EIGHT_INTEGER, EIGHTEEN_INTEGER, ELEMENT_TYPE_KEYWORD, ELEVEN_INTEGER, END_KEYWORD, ENFORCE_MUST, ENFORCE_TYPE, EQ, EQL, EQUAL, EQUALP, ERROR, ERROR_KEYWORD, ERROR_OUTPUT, EVAL, EXTERNAL_FORMAT_KEYWORD, EXTERNAL_KEYWORD, FIF, FIFTEEN_INTEGER, FIRST, FIVE_INTEGER, FIXNUMP, FLOATP, FOUR_INTEGER, FOURTEEN_INTEGER, FUNCTION, FUNCTION_SPEC_P, FUNCTIONP, FUNLESS, FWHEN, GET, GETHASH, GETHASH_WITHOUT_VALUES, GUID_P, HASH_TABLE_ITERATOR_P, HASH_TABLE_P, IDENTITY, IF_DOES_NOT_EXIST_KEYWORD, IF_EXISTS_KEYWORD, IGNORE, INITIALIZATION_TYPE, INITIALIZER, INPUT_KEYWORD, INPUT_STREAM_P, INTEGERP, INTERNAL_KEYWORD, IO_KEYWORD, KEYWORDP, KILL_KEYWORD, LAMBDA_SYMBOL, LEXICAL, LIST, LISTP, LISTS, LOCK_P, LONG_BIGNUM_P, MACRO_ENV, MACRO_FORM, MEDIUM_BIGNUM_P, MEMBER, MINUS_ONE_INTEGER, MULTIPLE_VALUE_LIST, MUST, NCONC, NEW_VERSION_KEYWORD, NIL, NINE_INTEGER, NINETEEN_INTEGER, NREVERSE, NTH, NTH_VALUE, NULL, NULL_INPUT, NULL_OUTPUT, NUM_E_SYMBOL, NUM_GT_SYMBOL, NUM_GTE_SYMBOL, NUM_LT_SYMBOL, NUM_LTE_SYMBOL, NUM_NE_SYMBOL, NUMBERP, ONE_HUNDRED_THIRTY_SEVEN_INTEGER, ONE_HUNDRED_TWENTY_SEVEN_INTEGER, ONE_INTEGER, ONE_THOUSAND_INTEGER, OPTIONAL_SYMBOL, OTHERWISE, OUTPUT_KEYWORD, OUTPUT_STREAM_P, OVERWRITE_KEYWORD, PACKAGEP, PCASE, PCOND, PIF, PROBE_KEYWORD, PROCESS_TO_END, PROCESSP, PROCLAIM, PROGN, PUNLESS, PWHEN, QUERY_IO, QUIT, QUOTE, RENAME_AND_DELETE_KEYWORD, REST_SYMBOL, RET, RET_NIL, RET_T, RETURN_TAG, REVERSE, RW_LOCK_P, SECOND, SEQUENCEP, SEVEN_INTEGER, SEVENTEEN_INTEGER, SHORT_BIGNUM_P, SHOW_STACK_TRACES, SIX_INTEGER, SIXTEEN_INTEGER, SIXTY_FOUR_INTEGER, SORT, SSS, STANDARD_INPUT, STANDARD_OUTPUT, START_KEYWORD, STREAMP, STRING_E_SYMBOL, STRING_EQUAL_SYMBOL, STRING_GREATER_THAN_OR_EQUAL_SYMBOL, STRING_GREATER_THAN_SYMBOL, STRING_GT_SYMBOL, STRING_GTE_SYMBOL, STRING_LESS_THAN_OR_EQUAL_SYMBOL, STRING_LESS_THAN_SYMBOL, STRING_LT_SYMBOL, STRING_LTE_SYMBOL, STRING_NE_SYMBOL, STRING_NOT_EQUAL_SYMBOL, STRINGP, STRUCTURE_P, SUPERSEDE_KEYWORD, SUSPEND_TYPE_CHECKING, SYMBOL_FUNCTION, SYMBOL_VALUE, SYMBOLP, T, TEN_INTEGER, TERMINAL_IO, TEXT_KEYWORD, THIRTEEN_INTEGER, THIRTY_FOUR_INTEGER, THIRTY_THREE_INTEGER, THIRTY_TWO_INTEGER, THREE_INTEGER, TRACE_OUTPUT, TRUE, TWELVE_INTEGER, TWENTY_INTEGER, TWO_HUNDRED_FIFTY_FOUR_INTEGER, TWO_HUNDRED_FORTY_FOUR_INTEGER, TWO_INTEGER, UNDECLARED, UNPROVIDED, VALUES, VECTOR, VECTORP, WITH_ERROR_HANDLER, WITH_STATIC_AREA, WITH_THREAD_PRIVATE_AREA, WITH_WORKING_AREA, WORLD, ZERO_DOUBLE, ZERO_INTEGER
 
Constructor Summary
UnitTest(java.lang.String name)
          Creates a new instance of UnitTest.
 
Method Summary
static void main(java.lang.String[] args)
           
static SubLObject readAndEval(java.lang.String str)
           
static void shouldPrintTests(java.lang.String msg)
           
static junit.framework.Test suite()
          Runs the unit tests
static void testAppend()
           
static void testBasicEquality()
           
static void testCand()
           
static void testCcatch()
           
static void testCDo()
           
static void testCDoHash()
           
static void testCDoList()
           
static void testCDoTimes()
           
static void testCharacterEquality()
           
static void testCharacterFormats()
           
static void testCharacterFunctions()
           
static void testClet()
           
static void testCMerge()
           
static void testCmultipleValueBind()
           
static void testCnot()
           
static void testCompiledSymbolProperties()
           
static void testCProgv()
           
static void testCPushAndCPop()
           
static void testCsetf()
           
static void testCsetq()
           
static void testCSome()
           
static void testCTime()
           
static void testCunwindProtect()
           
static void testCycLListComparison()
           
static void testCyclops()
           
static void testCycLSets()
           
static void testDefine()
           
static void testDefineCachedFunctions()
           
static void testDuplicateRemovalFunctions(boolean shouldTestFast)
           
static void testDynamicBinding()
           
static void testDynamicVariables()
           
static void testErrorEvaluation()
           
 void testErrorsAndWarnsGoToRightStream()
           
static void testEvalDoesNotError(java.lang.String str)
           
static void testEvalEquals(java.lang.String str1, java.lang.String str2)
           
static void testEvalEqualsObj(java.lang.Object obj, java.lang.String str)
          Throws an error unless STR evaluates to OBJ.
static void testEvalError(java.lang.String str)
           
static void testEvalNotEquals(java.lang.String str1, java.lang.String str2)
           
static void testEvalNotEqualsObj(java.lang.Object obj, java.lang.String str)
          Throws an error unless STR does not evaluates to OBJ.
static void testEvalOfType(java.lang.String str, java.lang.Class evalType)
           
static void testExternalProcessStreamClosing()
           
static void testFif()
          copied-n-edited from testPif
static void testFileSysFunctions()
           
static void testFixnumEquality()
           
static void testFormat()
           
static void testFunctions()
           
static void testGUIDs()
           
static void testHashtableExerciser()
           
static void testHashtables()
           
static void testInterpretedStructures()
           
static void testInterpretedSymbolProperties()
           
static void testKeyhashes()
           
static void testKeywordEquality()
           
 void testKeywords()
           
static void testLambdaFunctions()
           
static void testLexicalVariables()
           
static void testListEquality()
           
 void testLoadExternalCode()
           
static void testMapping()
           
static void testMathFunctions()
           
static void testMember()
           
static void testMultipleValues()
           
static void testNconc()
           
static void testNilEvaluation()
           
static void testNumberComparison()
           
static void testNumberEquality()
           
static void testNumberFormats()
           
static void testOneNonSelfEvaluation(java.lang.String str)
           
static void testOneSelfEvaluation(java.lang.String str)
          Throws an error if STR, after parsing, does not evaluate to itself.
static void testOptionalArgEvaluation()
           
static void testPackageFunctions()
           
static void testPcond()
           
static void testPif()
           
static void testPolymorphic()
           
static void testPrinterControlVars()
           
static void testProcesses()
           
static void testProgn()
           
static void testPunless()
           
static void testPwhen()
           
static void testQueues()
           
static void testQuote()
           
static void testReadloopErrorHandling()
           
static void testReadSequence()
           
 void testResourcer()
           
static void testRestArgEvaluation()
           
static void testSelfEvaluation()
           
static void testSequenceFunctions()
           
static void testSimpleFunctionEvaluation()
           
static void testSort()
           
 void testStreamFlushing()
           
static void testStringEquality()
           
static void testStringFunctions()
           
static void testStrings()
           
static void testStringStreams()
           
static void testSxhash()
           
static void testSymbolEquality()
           
static void testSymbolFunctions()
           
static void testSymbolNames()
           
 void testTerminalStreams()
           
static void testTimeMethods()
           
static void testTypePredicates()
           
static void testWithErrorHandler()
           
static void testWithTimeout()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, getName, run, run, runBare, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DIVISION_TEST_CASE_TABLE

public static final com.cyc.tool.subl.jrtl.nativeCode.subLisp.UnitTest.DivisionTest[] DIVISION_TEST_CASE_TABLE
Constructor Detail

UnitTest

public UnitTest(java.lang.String name)
Creates a new instance of UnitTest.

Method Detail

testSelfEvaluation

public static void testSelfEvaluation()

testNilEvaluation

public static void testNilEvaluation()

testSimpleFunctionEvaluation

public static void testSimpleFunctionEvaluation()

testErrorEvaluation

public static void testErrorEvaluation()

testCMerge

public static void testCMerge()

testOptionalArgEvaluation

public static void testOptionalArgEvaluation()

testRestArgEvaluation

public static void testRestArgEvaluation()

testQuote

public static void testQuote()

testProgn

public static void testProgn()

testReadloopErrorHandling

public static void testReadloopErrorHandling()

testPif

public static void testPif()

testPwhen

public static void testPwhen()

testPunless

public static void testPunless()

testPcond

public static void testPcond()

testLexicalVariables

public static void testLexicalVariables()

testDynamicVariables

public static void testDynamicVariables()

testCsetq

public static void testCsetq()

testClet

public static void testClet()

testCunwindProtect

public static void testCunwindProtect()

testCcatch

public static void testCcatch()

testMultipleValues

public static void testMultipleValues()

testCmultipleValueBind

public static void testCmultipleValueBind()

testFif

public static void testFif()
copied-n-edited from testPif


testBasicEquality

public static void testBasicEquality()

testSymbolEquality

public static void testSymbolEquality()

testInterpretedSymbolProperties

public static void testInterpretedSymbolProperties()

testCompiledSymbolProperties

public static void testCompiledSymbolProperties()

testKeywordEquality

public static void testKeywordEquality()

testCharacterEquality

public static void testCharacterEquality()

testStringEquality

public static void testStringEquality()

testFixnumEquality

public static void testFixnumEquality()

testListEquality

public static void testListEquality()

testLambdaFunctions

public static void testLambdaFunctions()

testNumberEquality

public static void testNumberEquality()

testNumberComparison

public static void testNumberComparison()

testNumberFormats

public static void testNumberFormats()

testCharacterFormats

public static void testCharacterFormats()

testSymbolNames

public static void testSymbolNames()

testStrings

public static void testStrings()

testTypePredicates

public static void testTypePredicates()

testMember

public static void testMember()

testCDoTimes

public static void testCDoTimes()

testCTime

public static void testCTime()

testCDoList

public static void testCDoList()

testCDoHash

public static void testCDoHash()

testCPushAndCPop

public static void testCPushAndCPop()

testMapping

public static void testMapping()

testDefine

public static void testDefine()

testProcesses

public static void testProcesses()

testHashtables

public static void testHashtables()

testKeyhashes

public static void testKeyhashes()

testHashtableExerciser

public static void testHashtableExerciser()

testSort

public static void testSort()

testCharacterFunctions

public static void testCharacterFunctions()

testStringFunctions

public static void testStringFunctions()

testPackageFunctions

public static void testPackageFunctions()

testSymbolFunctions

public static void testSymbolFunctions()

testExternalProcessStreamClosing

public static void testExternalProcessStreamClosing()

testDuplicateRemovalFunctions

public static void testDuplicateRemovalFunctions(boolean shouldTestFast)

testSequenceFunctions

public static void testSequenceFunctions()

testMathFunctions

public static void testMathFunctions()

testFileSysFunctions

public static void testFileSysFunctions()

testGUIDs

public static void testGUIDs()

testStringStreams

public static void testStringStreams()

testTimeMethods

public static void testTimeMethods()

testPolymorphic

public static void testPolymorphic()

testFunctions

public static void testFunctions()

testSxhash

public static void testSxhash()

testPrinterControlVars

public static void testPrinterControlVars()

testAppend

public static void testAppend()

testWithErrorHandler

public static void testWithErrorHandler()

testCyclops

public static void testCyclops()

testCycLSets

public static void testCycLSets()

testCycLListComparison

public static void testCycLListComparison()

testDefineCachedFunctions

public static void testDefineCachedFunctions()

testFormat

public static void testFormat()

testQueues

public static void testQueues()

testWithTimeout

public static final void testWithTimeout()

testDynamicBinding

public static final void testDynamicBinding()

testCsetf

public static final void testCsetf()

testCDo

public static final void testCDo()

testCProgv

public static final void testCProgv()

testCSome

public static final void testCSome()

testNconc

public static final void testNconc()

testCand

public static final void testCand()

testCnot

public static final void testCnot()

testInterpretedStructures

public static final void testInterpretedStructures()

testKeywords

public final void testKeywords()

testTerminalStreams

public final void testTerminalStreams()

testStreamFlushing

public final void testStreamFlushing()

testLoadExternalCode

public final void testLoadExternalCode()

testErrorsAndWarnsGoToRightStream

public void testErrorsAndWarnsGoToRightStream()

testResourcer

public final void testResourcer()

testReadSequence

public static final void testReadSequence()

suite

public static junit.framework.Test suite()
Runs the unit tests


readAndEval

public static SubLObject readAndEval(java.lang.String str)

testOneSelfEvaluation

public static void testOneSelfEvaluation(java.lang.String str)
Throws an error if STR, after parsing, does not evaluate to itself.


testOneNonSelfEvaluation

public static void testOneNonSelfEvaluation(java.lang.String str)

testEvalEqualsObj

public static void testEvalEqualsObj(java.lang.Object obj,
                                     java.lang.String str)
Throws an error unless STR evaluates to OBJ.


testEvalNotEqualsObj

public static void testEvalNotEqualsObj(java.lang.Object obj,
                                        java.lang.String str)
Throws an error unless STR does not evaluates to OBJ.


testEvalOfType

public static void testEvalOfType(java.lang.String str,
                                  java.lang.Class evalType)

testEvalEquals

public static void testEvalEquals(java.lang.String str1,
                                  java.lang.String str2)

testEvalNotEquals

public static void testEvalNotEquals(java.lang.String str1,
                                     java.lang.String str2)

testEvalError

public static void testEvalError(java.lang.String str)

testEvalDoesNotError

public static void testEvalDoesNotError(java.lang.String str)

shouldPrintTests

public static void shouldPrintTests(java.lang.String msg)

main

public static void main(java.lang.String[] args)
Parameters:
args - the command line arguments