Extract test instance lifecycle annotation
This commit is contained in:
parent
347857fbb5
commit
0efae35391
|
@ -13,17 +13,16 @@ import org.junit.Test
|
||||||
import org.junit.contrib.java.lang.system.ExpectedSystemExit
|
import org.junit.contrib.java.lang.system.ExpectedSystemExit
|
||||||
import org.junit.contrib.java.lang.system.SystemErrRule
|
import org.junit.contrib.java.lang.system.SystemErrRule
|
||||||
import org.junit.contrib.java.lang.system.SystemOutRule
|
import org.junit.contrib.java.lang.system.SystemOutRule
|
||||||
import org.junit.jupiter.api.TestInstance
|
|
||||||
import org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS
|
|
||||||
import terminal.TerminalConfiguration
|
import terminal.TerminalConfiguration
|
||||||
import terminal.VirtualTerminalInteractor
|
import terminal.VirtualTerminalInteractor
|
||||||
|
import testutil.LispTestInstance
|
||||||
import testutil.SymbolAndFunctionCleaner
|
import testutil.SymbolAndFunctionCleaner
|
||||||
import java.io.PipedInputStream
|
import java.io.PipedInputStream
|
||||||
import java.io.PipedOutputStream
|
import java.io.PipedOutputStream
|
||||||
import java.text.MessageFormat.format
|
import java.text.MessageFormat.format
|
||||||
import java.util.concurrent.CountDownLatch
|
import java.util.concurrent.CountDownLatch
|
||||||
|
|
||||||
@TestInstance(PER_CLASS)
|
@LispTestInstance
|
||||||
class MainTest : SymbolAndFunctionCleaner() {
|
class MainTest : SymbolAndFunctionCleaner() {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
|
@ -5,10 +5,10 @@ import org.assertj.core.api.Assertions.assertThat
|
||||||
import org.junit.jupiter.api.AfterEach
|
import org.junit.jupiter.api.AfterEach
|
||||||
import org.junit.jupiter.api.BeforeEach
|
import org.junit.jupiter.api.BeforeEach
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import org.junit.jupiter.api.TestInstance
|
import testutil.LispTestInstance
|
||||||
import org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS
|
|
||||||
|
|
||||||
@TestInstance(PER_CLASS)
|
|
||||||
|
@LispTestInstance
|
||||||
class RuntimeEnvironmentTest {
|
class RuntimeEnvironmentTest {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
|
@ -8,12 +8,12 @@ import org.assertj.core.api.Assertions.assertThat
|
||||||
import org.junit.jupiter.api.AfterEach
|
import org.junit.jupiter.api.AfterEach
|
||||||
import org.junit.jupiter.api.BeforeEach
|
import org.junit.jupiter.api.BeforeEach
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import org.junit.jupiter.api.TestInstance
|
import testutil.LispTestInstance
|
||||||
import org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS
|
|
||||||
import java.io.ByteArrayOutputStream
|
import java.io.ByteArrayOutputStream
|
||||||
import java.io.PrintStream
|
import java.io.PrintStream
|
||||||
|
|
||||||
@TestInstance(PER_CLASS)
|
@LispTestInstance
|
||||||
class ErrorManagerTest {
|
class ErrorManagerTest {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
|
@ -3,10 +3,9 @@ package file
|
||||||
import org.assertj.core.api.Assertions.assertThat
|
import org.assertj.core.api.Assertions.assertThat
|
||||||
import org.junit.jupiter.api.BeforeEach
|
import org.junit.jupiter.api.BeforeEach
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import org.junit.jupiter.api.TestInstance
|
import testutil.LispTestInstance
|
||||||
import org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS
|
|
||||||
|
|
||||||
@TestInstance(PER_CLASS)
|
@LispTestInstance
|
||||||
class FilePositionTrackerTest {
|
class FilePositionTrackerTest {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
|
@ -7,17 +7,16 @@ import function.ArgumentValidator.TooManyArgumentsException
|
||||||
import org.junit.jupiter.api.Assertions.assertThrows
|
import org.junit.jupiter.api.Assertions.assertThrows
|
||||||
import org.junit.jupiter.api.BeforeEach
|
import org.junit.jupiter.api.BeforeEach
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import org.junit.jupiter.api.TestInstance
|
|
||||||
import org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS
|
|
||||||
import sexpression.Cons
|
import sexpression.Cons
|
||||||
import sexpression.LispString
|
import sexpression.LispString
|
||||||
import sexpression.Nil
|
import sexpression.Nil
|
||||||
import sexpression.SExpression
|
import sexpression.SExpression
|
||||||
import sexpression.Symbol
|
import sexpression.Symbol
|
||||||
import sexpression.Symbol.Companion.T
|
import sexpression.Symbol.Companion.T
|
||||||
|
import testutil.LispTestInstance
|
||||||
import testutil.TestUtilities.assertIsErrorWithMessage
|
import testutil.TestUtilities.assertIsErrorWithMessage
|
||||||
|
|
||||||
@TestInstance(PER_CLASS)
|
@LispTestInstance
|
||||||
class ArgumentValidatorTest {
|
class ArgumentValidatorTest {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
|
@ -2,12 +2,11 @@ package function
|
||||||
|
|
||||||
import org.assertj.core.api.Assertions.assertThat
|
import org.assertj.core.api.Assertions.assertThat
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import org.junit.jupiter.api.TestInstance
|
|
||||||
import org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS
|
|
||||||
import sexpression.Cons
|
import sexpression.Cons
|
||||||
import sexpression.Nil
|
import sexpression.Nil
|
||||||
|
import testutil.LispTestInstance
|
||||||
|
|
||||||
@TestInstance(PER_CLASS)
|
@LispTestInstance
|
||||||
class LispFunctionTest {
|
class LispFunctionTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -2,12 +2,11 @@ package function
|
||||||
|
|
||||||
import org.assertj.core.api.Assertions.assertThat
|
import org.assertj.core.api.Assertions.assertThat
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import org.junit.jupiter.api.TestInstance
|
|
||||||
import org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS
|
|
||||||
import sexpression.Cons
|
import sexpression.Cons
|
||||||
import sexpression.Nil
|
import sexpression.Nil
|
||||||
|
import testutil.LispTestInstance
|
||||||
|
|
||||||
@TestInstance(PER_CLASS)
|
@LispTestInstance
|
||||||
class LispSpecialFunctionTest {
|
class LispSpecialFunctionTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -6,16 +6,15 @@ import function.UserDefinedFunction.IllegalKeywordRestPositionException
|
||||||
import org.assertj.core.api.Assertions.assertThat
|
import org.assertj.core.api.Assertions.assertThat
|
||||||
import org.junit.jupiter.api.Assertions.assertThrows
|
import org.junit.jupiter.api.Assertions.assertThrows
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import org.junit.jupiter.api.TestInstance
|
|
||||||
import org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS
|
|
||||||
import sexpression.Cons
|
import sexpression.Cons
|
||||||
import sexpression.LispNumber
|
import sexpression.LispNumber
|
||||||
import sexpression.Nil
|
import sexpression.Nil
|
||||||
import sexpression.Symbol
|
import sexpression.Symbol
|
||||||
|
import testutil.LispTestInstance
|
||||||
import testutil.TestUtilities.assertIsErrorWithMessage
|
import testutil.TestUtilities.assertIsErrorWithMessage
|
||||||
import testutil.TestUtilities.assertSExpressionsMatch
|
import testutil.TestUtilities.assertSExpressionsMatch
|
||||||
|
|
||||||
@TestInstance(PER_CLASS)
|
@LispTestInstance
|
||||||
class UserDefinedFunctionTest {
|
class UserDefinedFunctionTest {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
|
@ -13,17 +13,16 @@ import function.builtin.special.RECUR.RecurNotInTailPositionException
|
||||||
import org.assertj.core.api.Assertions.assertThat
|
import org.assertj.core.api.Assertions.assertThat
|
||||||
import org.junit.jupiter.api.Assertions.assertThrows
|
import org.junit.jupiter.api.Assertions.assertThrows
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import org.junit.jupiter.api.TestInstance
|
|
||||||
import org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS
|
|
||||||
import org.junit.jupiter.api.fail
|
import org.junit.jupiter.api.fail
|
||||||
import sexpression.Nil
|
import sexpression.Nil
|
||||||
|
import testutil.LispTestInstance
|
||||||
import testutil.SymbolAndFunctionCleaner
|
import testutil.SymbolAndFunctionCleaner
|
||||||
import testutil.TestUtilities.assertIsErrorWithMessage
|
import testutil.TestUtilities.assertIsErrorWithMessage
|
||||||
import testutil.TestUtilities.assertSExpressionsMatch
|
import testutil.TestUtilities.assertSExpressionsMatch
|
||||||
import testutil.TestUtilities.evaluateString
|
import testutil.TestUtilities.evaluateString
|
||||||
import testutil.TestUtilities.parseString
|
import testutil.TestUtilities.parseString
|
||||||
|
|
||||||
@TestInstance(PER_CLASS)
|
@LispTestInstance
|
||||||
class EvalTest : SymbolAndFunctionCleaner() {
|
class EvalTest : SymbolAndFunctionCleaner() {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -5,12 +5,12 @@ import function.ArgumentValidator.TooManyArgumentsException
|
||||||
import org.assertj.core.api.Assertions.assertThat
|
import org.assertj.core.api.Assertions.assertThat
|
||||||
import org.junit.jupiter.api.Assertions.assertThrows
|
import org.junit.jupiter.api.Assertions.assertThrows
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import org.junit.jupiter.api.TestInstance
|
import testutil.LispTestInstance
|
||||||
import org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS
|
|
||||||
import testutil.SymbolAndFunctionCleaner
|
import testutil.SymbolAndFunctionCleaner
|
||||||
import testutil.TestUtilities.evaluateString
|
import testutil.TestUtilities.evaluateString
|
||||||
|
|
||||||
@TestInstance(PER_CLASS)
|
@LispTestInstance
|
||||||
class ExitTest : SymbolAndFunctionCleaner() {
|
class ExitTest : SymbolAndFunctionCleaner() {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
|
@ -4,14 +4,14 @@ import function.ArgumentValidator.BadArgumentTypeException
|
||||||
import function.ArgumentValidator.TooFewArgumentsException
|
import function.ArgumentValidator.TooFewArgumentsException
|
||||||
import org.junit.jupiter.api.Assertions.assertThrows
|
import org.junit.jupiter.api.Assertions.assertThrows
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import org.junit.jupiter.api.TestInstance
|
import testutil.LispTestInstance
|
||||||
import org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS
|
|
||||||
import testutil.SymbolAndFunctionCleaner
|
import testutil.SymbolAndFunctionCleaner
|
||||||
import testutil.TestUtilities.evaluateString
|
import testutil.TestUtilities.evaluateString
|
||||||
import testutil.TypeAssertions.assertNil
|
import testutil.TypeAssertions.assertNil
|
||||||
import testutil.TypeAssertions.assertT
|
import testutil.TypeAssertions.assertT
|
||||||
|
|
||||||
@TestInstance(PER_CLASS)
|
@LispTestInstance
|
||||||
class NumericEqualTest : SymbolAndFunctionCleaner() {
|
class NumericEqualTest : SymbolAndFunctionCleaner() {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -6,13 +6,13 @@ import org.assertj.core.api.Assertions.assertThat
|
||||||
import org.junit.jupiter.api.AfterEach
|
import org.junit.jupiter.api.AfterEach
|
||||||
import org.junit.jupiter.api.BeforeEach
|
import org.junit.jupiter.api.BeforeEach
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import org.junit.jupiter.api.TestInstance
|
import testutil.LispTestInstance
|
||||||
import org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS
|
|
||||||
import testutil.TestUtilities.createInputStreamFromString
|
import testutil.TestUtilities.createInputStreamFromString
|
||||||
import java.io.ByteArrayOutputStream
|
import java.io.ByteArrayOutputStream
|
||||||
import java.io.PrintStream
|
import java.io.PrintStream
|
||||||
|
|
||||||
@TestInstance(PER_CLASS)
|
@LispTestInstance
|
||||||
class LispInterpreterTest {
|
class LispInterpreterTest {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
|
@ -5,10 +5,9 @@ import org.assertj.core.api.Assertions.assertThat
|
||||||
import org.junit.jupiter.api.Assertions.assertThrows
|
import org.junit.jupiter.api.Assertions.assertThrows
|
||||||
import org.junit.jupiter.api.Assertions.fail
|
import org.junit.jupiter.api.Assertions.fail
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import org.junit.jupiter.api.TestInstance
|
|
||||||
import org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS
|
|
||||||
import scanner.LispScanner.UnterminatedStringException
|
import scanner.LispScanner.UnterminatedStringException
|
||||||
import stream.LispIOException
|
import stream.LispIOException
|
||||||
|
import testutil.LispTestInstance
|
||||||
import testutil.TestUtilities.assertIsErrorWithMessage
|
import testutil.TestUtilities.assertIsErrorWithMessage
|
||||||
import testutil.TestUtilities.createIOExceptionThrowingInputStream
|
import testutil.TestUtilities.createIOExceptionThrowingInputStream
|
||||||
import testutil.TestUtilities.createInputStreamFromString
|
import testutil.TestUtilities.createInputStreamFromString
|
||||||
|
@ -24,7 +23,7 @@ import token.Eof.EofEncounteredException
|
||||||
import token.RightParenthesis.StartsWithRightParenthesisException
|
import token.RightParenthesis.StartsWithRightParenthesisException
|
||||||
import token.TokenFactory.BadCharacterException
|
import token.TokenFactory.BadCharacterException
|
||||||
|
|
||||||
@TestInstance(PER_CLASS)
|
@LispTestInstance
|
||||||
class LispParserTest {
|
class LispParserTest {
|
||||||
|
|
||||||
private fun createLispParser(input: String) = LispParser(createInputStreamFromString(input), "testFile")
|
private fun createLispParser(input: String) = LispParser(createInputStreamFromString(input), "testFile")
|
||||||
|
|
|
@ -2,11 +2,10 @@ package recursion
|
||||||
|
|
||||||
import org.junit.jupiter.api.Assertions.assertThrows
|
import org.junit.jupiter.api.Assertions.assertThrows
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import org.junit.jupiter.api.TestInstance
|
|
||||||
import org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS
|
|
||||||
import recursion.TailCalls.done
|
import recursion.TailCalls.done
|
||||||
|
import testutil.LispTestInstance
|
||||||
|
|
||||||
@TestInstance(PER_CLASS)
|
@LispTestInstance
|
||||||
class TailCallTest {
|
class TailCallTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -4,14 +4,13 @@ import error.Severity.CRITICAL
|
||||||
import org.assertj.core.api.Assertions.assertThat
|
import org.assertj.core.api.Assertions.assertThat
|
||||||
import org.junit.jupiter.api.Assertions.assertThrows
|
import org.junit.jupiter.api.Assertions.assertThrows
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import org.junit.jupiter.api.TestInstance
|
|
||||||
import org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS
|
|
||||||
import scanner.LispInputStream.MaximumUnreadsExceededException
|
import scanner.LispInputStream.MaximumUnreadsExceededException
|
||||||
import stream.LispIOException
|
import stream.LispIOException
|
||||||
|
import testutil.LispTestInstance
|
||||||
import testutil.TestUtilities.createIOExceptionThrowingInputStream
|
import testutil.TestUtilities.createIOExceptionThrowingInputStream
|
||||||
import testutil.TestUtilities.createInputStreamFromString
|
import testutil.TestUtilities.createInputStreamFromString
|
||||||
|
|
||||||
@TestInstance(PER_CLASS)
|
@LispTestInstance
|
||||||
class LispCommentRemovingInputStreamTest {
|
class LispCommentRemovingInputStreamTest {
|
||||||
|
|
||||||
private fun getLispCommentRemovingInputStreamResult(inputString: String) =
|
private fun getLispCommentRemovingInputStreamResult(inputString: String) =
|
||||||
|
|
|
@ -3,11 +3,11 @@ package scanner
|
||||||
import file.FilePosition
|
import file.FilePosition
|
||||||
import org.assertj.core.api.Assertions.assertThat
|
import org.assertj.core.api.Assertions.assertThat
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import org.junit.jupiter.api.TestInstance
|
import testutil.LispTestInstance
|
||||||
import org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS
|
|
||||||
import testutil.TestUtilities.createInputStreamFromString
|
import testutil.TestUtilities.createInputStreamFromString
|
||||||
|
|
||||||
@TestInstance(PER_CLASS)
|
@LispTestInstance
|
||||||
class LispScannerLineColumnTest {
|
class LispScannerLineColumnTest {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
|
@ -2,11 +2,11 @@ package scanner
|
||||||
|
|
||||||
import org.assertj.core.api.Assertions.assertThat
|
import org.assertj.core.api.Assertions.assertThat
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import org.junit.jupiter.api.TestInstance
|
import testutil.LispTestInstance
|
||||||
import org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS
|
|
||||||
import testutil.TestUtilities.createInputStreamFromString
|
import testutil.TestUtilities.createInputStreamFromString
|
||||||
|
|
||||||
@TestInstance(PER_CLASS)
|
@LispTestInstance
|
||||||
class LispScannerTextTest {
|
class LispScannerTextTest {
|
||||||
|
|
||||||
private fun assertTokenTextMatches(input: String, expectedText: Array<String>) {
|
private fun assertTokenTextMatches(input: String, expectedText: Array<String>) {
|
||||||
|
|
|
@ -4,9 +4,8 @@ import org.assertj.core.api.Assertions.assertThat
|
||||||
import org.junit.jupiter.api.Assertions.assertThrows
|
import org.junit.jupiter.api.Assertions.assertThrows
|
||||||
import org.junit.jupiter.api.BeforeEach
|
import org.junit.jupiter.api.BeforeEach
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import org.junit.jupiter.api.TestInstance
|
|
||||||
import org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS
|
|
||||||
import scanner.LispScanner.UnterminatedStringException
|
import scanner.LispScanner.UnterminatedStringException
|
||||||
|
import testutil.LispTestInstance
|
||||||
import testutil.TestUtilities.assertIsErrorWithMessage
|
import testutil.TestUtilities.assertIsErrorWithMessage
|
||||||
import testutil.TestUtilities.createInputStreamFromString
|
import testutil.TestUtilities.createInputStreamFromString
|
||||||
import token.AtSign
|
import token.AtSign
|
||||||
|
@ -22,7 +21,7 @@ import token.RightParenthesis
|
||||||
import token.Token
|
import token.Token
|
||||||
import token.TokenFactory.BadCharacterException
|
import token.TokenFactory.BadCharacterException
|
||||||
|
|
||||||
@TestInstance(PER_CLASS)
|
@LispTestInstance
|
||||||
class LispScannerTypeTest {
|
class LispScannerTypeTest {
|
||||||
|
|
||||||
private val expectedTypes = mutableListOf<Class<out Token>>()
|
private val expectedTypes = mutableListOf<Class<out Token>>()
|
||||||
|
|
|
@ -4,16 +4,15 @@ import function.UserDefinedFunction
|
||||||
import org.assertj.core.api.Assertions.assertThat
|
import org.assertj.core.api.Assertions.assertThat
|
||||||
import org.junit.jupiter.api.Assertions.assertThrows
|
import org.junit.jupiter.api.Assertions.assertThrows
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import org.junit.jupiter.api.TestInstance
|
|
||||||
import org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS
|
|
||||||
import sexpression.LispNumber.InvalidNumberException
|
import sexpression.LispNumber.InvalidNumberException
|
||||||
|
import testutil.LispTestInstance
|
||||||
import testutil.TestUtilities.assertIsErrorWithMessage
|
import testutil.TestUtilities.assertIsErrorWithMessage
|
||||||
import testutil.TestUtilities.assertSExpressionsMatch
|
import testutil.TestUtilities.assertSExpressionsMatch
|
||||||
import testutil.TestUtilities.makeList
|
import testutil.TestUtilities.makeList
|
||||||
import java.math.BigInteger
|
import java.math.BigInteger
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
|
|
||||||
@TestInstance(PER_CLASS)
|
@LispTestInstance
|
||||||
class SExpressionTest {
|
class SExpressionTest {
|
||||||
|
|
||||||
private fun assertSExpressionMatchesString(expected: String, sExpression: SExpression) {
|
private fun assertSExpressionMatchesString(expected: String, sExpression: SExpression) {
|
||||||
|
|
|
@ -4,13 +4,12 @@ import org.assertj.core.api.Assertions.assertThat
|
||||||
import org.junit.jupiter.api.Assertions.assertThrows
|
import org.junit.jupiter.api.Assertions.assertThrows
|
||||||
import org.junit.jupiter.api.BeforeEach
|
import org.junit.jupiter.api.BeforeEach
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import org.junit.jupiter.api.TestInstance
|
import testutil.LispTestInstance
|
||||||
import org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS
|
|
||||||
import testutil.TestUtilities.createIOExceptionThrowingInputStream
|
import testutil.TestUtilities.createIOExceptionThrowingInputStream
|
||||||
import testutil.TestUtilities.createInputStreamFromString
|
import testutil.TestUtilities.createInputStreamFromString
|
||||||
import util.Characters.EOF
|
import util.Characters.EOF
|
||||||
|
|
||||||
@TestInstance(PER_CLASS)
|
@LispTestInstance
|
||||||
class SafeInputStreamTest {
|
class SafeInputStreamTest {
|
||||||
|
|
||||||
private lateinit var safe: SafeInputStream
|
private lateinit var safe: SafeInputStream
|
||||||
|
|
|
@ -4,12 +4,11 @@ import org.assertj.core.api.Assertions.assertThat
|
||||||
import org.junit.jupiter.api.Assertions.assertThrows
|
import org.junit.jupiter.api.Assertions.assertThrows
|
||||||
import org.junit.jupiter.api.BeforeEach
|
import org.junit.jupiter.api.BeforeEach
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import org.junit.jupiter.api.TestInstance
|
import testutil.LispTestInstance
|
||||||
import org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS
|
|
||||||
import testutil.TestUtilities.createIOExceptionThrowingOutputStream
|
import testutil.TestUtilities.createIOExceptionThrowingOutputStream
|
||||||
import java.io.ByteArrayOutputStream
|
import java.io.ByteArrayOutputStream
|
||||||
|
|
||||||
@TestInstance(PER_CLASS)
|
@LispTestInstance
|
||||||
class SafeOutputStreamTest {
|
class SafeOutputStreamTest {
|
||||||
|
|
||||||
private lateinit var safe: SafeOutputStream
|
private lateinit var safe: SafeOutputStream
|
||||||
|
|
|
@ -4,13 +4,12 @@ import org.assertj.core.api.Assertions.assertThat
|
||||||
import org.junit.jupiter.api.AfterEach
|
import org.junit.jupiter.api.AfterEach
|
||||||
import org.junit.jupiter.api.BeforeEach
|
import org.junit.jupiter.api.BeforeEach
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import org.junit.jupiter.api.TestInstance
|
|
||||||
import org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS
|
|
||||||
import sexpression.Nil
|
import sexpression.Nil
|
||||||
import sexpression.Symbol.Companion.T
|
import sexpression.Symbol.Companion.T
|
||||||
import table.SymbolTable.NullSymbolTable
|
import table.SymbolTable.NullSymbolTable
|
||||||
|
import testutil.LispTestInstance
|
||||||
|
|
||||||
@TestInstance(PER_CLASS)
|
@LispTestInstance
|
||||||
class ExecutionContextTest {
|
class ExecutionContextTest {
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
|
|
|
@ -8,8 +8,6 @@ import org.junit.jupiter.api.AfterEach
|
||||||
import org.junit.jupiter.api.Assertions.assertThrows
|
import org.junit.jupiter.api.Assertions.assertThrows
|
||||||
import org.junit.jupiter.api.BeforeEach
|
import org.junit.jupiter.api.BeforeEach
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import org.junit.jupiter.api.TestInstance
|
|
||||||
import org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS
|
|
||||||
import sexpression.Cons
|
import sexpression.Cons
|
||||||
import sexpression.LispString
|
import sexpression.LispString
|
||||||
import sexpression.Nil
|
import sexpression.Nil
|
||||||
|
@ -19,8 +17,9 @@ import table.FunctionTable.defineFunction
|
||||||
import table.FunctionTable.isAlreadyDefined
|
import table.FunctionTable.isAlreadyDefined
|
||||||
import table.FunctionTable.lookupFunction
|
import table.FunctionTable.lookupFunction
|
||||||
import table.FunctionTable.resetFunctionTable
|
import table.FunctionTable.resetFunctionTable
|
||||||
|
import testutil.LispTestInstance
|
||||||
|
|
||||||
@TestInstance(PER_CLASS)
|
@LispTestInstance
|
||||||
class FunctionTableTest {
|
class FunctionTableTest {
|
||||||
|
|
||||||
@FunctionNames("GOOD")
|
@FunctionNames("GOOD")
|
||||||
|
|
|
@ -3,12 +3,11 @@ package table
|
||||||
import org.assertj.core.api.Assertions.assertThat
|
import org.assertj.core.api.Assertions.assertThat
|
||||||
import org.junit.jupiter.api.BeforeEach
|
import org.junit.jupiter.api.BeforeEach
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import org.junit.jupiter.api.TestInstance
|
|
||||||
import org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS
|
|
||||||
import sexpression.Nil
|
import sexpression.Nil
|
||||||
import sexpression.Symbol.Companion.T
|
import sexpression.Symbol.Companion.T
|
||||||
|
import testutil.LispTestInstance
|
||||||
|
|
||||||
@TestInstance(PER_CLASS)
|
@LispTestInstance
|
||||||
class SymbolTableTest {
|
class SymbolTableTest {
|
||||||
|
|
||||||
private lateinit var symbolTable: SymbolTable
|
private lateinit var symbolTable: SymbolTable
|
||||||
|
|
|
@ -3,8 +3,6 @@ package terminal
|
||||||
import org.assertj.core.api.Assertions.assertThat
|
import org.assertj.core.api.Assertions.assertThat
|
||||||
import org.junit.jupiter.api.BeforeEach
|
import org.junit.jupiter.api.BeforeEach
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import org.junit.jupiter.api.TestInstance
|
|
||||||
import org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS
|
|
||||||
import stream.SafeInputStream
|
import stream.SafeInputStream
|
||||||
import terminal.ControlSequence.NullControlSequence
|
import terminal.ControlSequence.NullControlSequence
|
||||||
import terminal.ControlSequenceHandler.Companion.isEscape
|
import terminal.ControlSequenceHandler.Companion.isEscape
|
||||||
|
@ -13,10 +11,11 @@ import terminal.SelectGraphicRendition.PURPLE
|
||||||
import terminal.SelectGraphicRendition.RED
|
import terminal.SelectGraphicRendition.RED
|
||||||
import terminal.SelectGraphicRendition.RESET
|
import terminal.SelectGraphicRendition.RESET
|
||||||
import terminal.SelectGraphicRendition.YELLOW
|
import terminal.SelectGraphicRendition.YELLOW
|
||||||
|
import testutil.LispTestInstance
|
||||||
import testutil.TestUtilities
|
import testutil.TestUtilities
|
||||||
import util.Characters.EOF
|
import util.Characters.EOF
|
||||||
|
|
||||||
@TestInstance(PER_CLASS)
|
@LispTestInstance
|
||||||
class ControlSequenceHandlerTest {
|
class ControlSequenceHandlerTest {
|
||||||
|
|
||||||
private lateinit var handler: ControlSequenceHandler
|
private lateinit var handler: ControlSequenceHandler
|
||||||
|
|
|
@ -6,17 +6,16 @@ import com.googlecode.lanterna.terminal.virtual.VirtualTerminal
|
||||||
import org.assertj.core.api.Assertions.assertThat
|
import org.assertj.core.api.Assertions.assertThat
|
||||||
import org.junit.jupiter.api.BeforeEach
|
import org.junit.jupiter.api.BeforeEach
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import org.junit.jupiter.api.TestInstance
|
|
||||||
import org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS
|
|
||||||
import terminal.ControlSequence.NullControlSequence
|
import terminal.ControlSequence.NullControlSequence
|
||||||
import terminal.SelectGraphicRendition.GREEN
|
import terminal.SelectGraphicRendition.GREEN
|
||||||
import terminal.SelectGraphicRendition.PURPLE
|
import terminal.SelectGraphicRendition.PURPLE
|
||||||
import terminal.SelectGraphicRendition.RED
|
import terminal.SelectGraphicRendition.RED
|
||||||
import terminal.SelectGraphicRendition.RESET
|
import terminal.SelectGraphicRendition.RESET
|
||||||
import terminal.SelectGraphicRendition.YELLOW
|
import terminal.SelectGraphicRendition.YELLOW
|
||||||
|
import testutil.LispTestInstance
|
||||||
import java.util.HashSet
|
import java.util.HashSet
|
||||||
|
|
||||||
@TestInstance(PER_CLASS)
|
@LispTestInstance
|
||||||
class ControlSequenceTest {
|
class ControlSequenceTest {
|
||||||
|
|
||||||
private lateinit var indicatorSet: MutableSet<String>
|
private lateinit var indicatorSet: MutableSet<String>
|
||||||
|
|
|
@ -11,11 +11,10 @@ import com.googlecode.lanterna.input.KeyType.Escape
|
||||||
import org.junit.jupiter.api.AfterEach
|
import org.junit.jupiter.api.AfterEach
|
||||||
import org.junit.jupiter.api.BeforeEach
|
import org.junit.jupiter.api.BeforeEach
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import org.junit.jupiter.api.TestInstance
|
|
||||||
import org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS
|
|
||||||
import terminal.LispTerminal.Companion.END_OF_SEGMENT
|
import terminal.LispTerminal.Companion.END_OF_SEGMENT
|
||||||
|
import testutil.LispTestInstance
|
||||||
|
|
||||||
@TestInstance(PER_CLASS)
|
@LispTestInstance
|
||||||
class LispTerminalTest {
|
class LispTerminalTest {
|
||||||
|
|
||||||
private lateinit var terminal: VirtualTerminalInteractor
|
private lateinit var terminal: VirtualTerminalInteractor
|
||||||
|
|
|
@ -3,14 +3,13 @@ package terminal
|
||||||
import org.junit.jupiter.api.Assertions.assertThrows
|
import org.junit.jupiter.api.Assertions.assertThrows
|
||||||
import org.junit.jupiter.api.BeforeEach
|
import org.junit.jupiter.api.BeforeEach
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import org.junit.jupiter.api.TestInstance
|
|
||||||
import org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS
|
|
||||||
import stream.LispIOException
|
import stream.LispIOException
|
||||||
|
import testutil.LispTestInstance
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
import java.io.PipedInputStream
|
import java.io.PipedInputStream
|
||||||
import java.io.PipedOutputStream
|
import java.io.PipedOutputStream
|
||||||
|
|
||||||
@TestInstance(PER_CLASS)
|
@LispTestInstance
|
||||||
class TerminalConfigurationTest {
|
class TerminalConfigurationTest {
|
||||||
|
|
||||||
private lateinit var configuration: TerminalConfiguration
|
private lateinit var configuration: TerminalConfiguration
|
||||||
|
|
|
@ -4,10 +4,9 @@ import org.assertj.core.api.Assertions.assertThat
|
||||||
import org.junit.jupiter.api.BeforeEach
|
import org.junit.jupiter.api.BeforeEach
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
|
|
||||||
import org.junit.jupiter.api.TestInstance
|
import testutil.LispTestInstance
|
||||||
import org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS
|
|
||||||
|
|
||||||
@TestInstance(PER_CLASS)
|
@LispTestInstance
|
||||||
class TerminalHistoryTest {
|
class TerminalHistoryTest {
|
||||||
|
|
||||||
private lateinit var history: TerminalHistory
|
private lateinit var history: TerminalHistory
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
package testutil
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.TestInstance
|
||||||
|
import org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS
|
||||||
|
import kotlin.annotation.AnnotationTarget.CLASS
|
||||||
|
|
||||||
|
@Target(CLASS)
|
||||||
|
@TestInstance(PER_CLASS)
|
||||||
|
annotation class LispTestInstance
|
|
@ -6,12 +6,12 @@ import org.assertj.core.api.Assertions.assertThat
|
||||||
import org.junit.jupiter.api.Assertions.assertThrows
|
import org.junit.jupiter.api.Assertions.assertThrows
|
||||||
import org.junit.jupiter.api.BeforeEach
|
import org.junit.jupiter.api.BeforeEach
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import org.junit.jupiter.api.TestInstance
|
import testutil.LispTestInstance
|
||||||
import org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS
|
|
||||||
import token.TokenFactory.BadCharacterException
|
import token.TokenFactory.BadCharacterException
|
||||||
import token.TokenFactory.EmptyTokenTextException
|
import token.TokenFactory.EmptyTokenTextException
|
||||||
|
|
||||||
@TestInstance(PER_CLASS)
|
@LispTestInstance
|
||||||
class TokenFactoryTest {
|
class TokenFactoryTest {
|
||||||
|
|
||||||
private lateinit var tokenFactory: TokenFactory
|
private lateinit var tokenFactory: TokenFactory
|
||||||
|
@ -80,7 +80,7 @@ class TokenFactoryTest {
|
||||||
try {
|
try {
|
||||||
createToken("")
|
createToken("")
|
||||||
} catch (e: EmptyTokenTextException) {
|
} catch (e: EmptyTokenTextException) {
|
||||||
assertThat(e.message).isNotEmpty();
|
assertThat(e.message).isNotEmpty()
|
||||||
assertThat(e.severity).isEqualTo(CRITICAL)
|
assertThat(e.severity).isEqualTo(CRITICAL)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue