From 0868a721a647a1d73f3424517f4970f909d46507 Mon Sep 17 00:00:00 2001 From: Ryan Hagenson Date: Wed, 15 Sep 2021 19:58:35 -0500 Subject: [PATCH 1/7] Reorder tests alphabetically --- packages/buffered/_test.pony | 3 +- packages/builtin_test/_test.pony | 125 +++++++++++---------- packages/bureaucracy/_test.pony | 1 + packages/cli/_test.pony | 33 +++--- packages/collections/_test.pony | 37 +++--- packages/collections/persistent/_test.pony | 17 +-- packages/encode/base64/_test.pony | 3 +- packages/files/_test.pony | 75 ++++++------- packages/format/_test.pony | 1 + packages/ini/_test.pony | 1 + packages/itertools/_test.pony | 5 +- packages/json/_test.pony | 18 ++- packages/logger/_test.pony | 5 +- packages/math/_test.pony | 7 +- packages/net/_test.pony | 19 ++-- packages/process/_test.pony | 19 ++-- packages/promises/_test.pony | 11 +- packages/random/_test.pony | 3 +- packages/serialise/_test.pony | 5 +- packages/stdlib/_test.pony | 7 +- packages/strings/_test.pony | 1 + packages/time/_test.pony | 1 + 22 files changed, 207 insertions(+), 190 deletions(-) diff --git a/packages/buffered/_test.pony b/packages/buffered/_test.pony index 48170a2463..9fc4762477 100644 --- a/packages/buffered/_test.pony +++ b/packages/buffered/_test.pony @@ -5,10 +5,10 @@ actor Main is TestList new make() => None fun tag tests(test: PonyTest) => + // Tests below function across all systems and are listed alphabetically test(_TestReader) test(_TestWriter) - class iso _TestReader is UnitTest """ Test adding to and reading from a Reader. @@ -198,7 +198,6 @@ class iso _TestReader is UnitTest // the last byte is consumed by the reader h.assert_eq[USize](b.size(), 0) - class iso _TestWriter is UnitTest """ Test writing to and reading from a Writer. diff --git a/packages/builtin_test/_test.pony b/packages/builtin_test/_test.pony index c97253d178..cccc4c170f 100644 --- a/packages/builtin_test/_test.pony +++ b/packages/builtin_test/_test.pony @@ -21,82 +21,83 @@ actor Main is TestList new make() => None fun tag tests(test: PonyTest) => + // Tests below function across all systems and are listed alphabetically test(_TestAbs) - test(_TestRotate) - test(_TestStringRunes) - test(_TestIntToString) - test(_TestFloatToString) - test(_TestStringToBool) - test(_TestStringToFloat) - test(_TestStringToU8) - test(_TestStringToI8) - test(_TestStringToIntLarge) - test(_TestStringLstrip) - test(_TestStringRstrip) - test(_TestStringStrip) - test(_TestStringStripNonAscii) - test(_TestStringRemove) - test(_TestStringSubstring) - test(_TestStringCut) - test(_TestStringTrim) - test(_TestStringTrimInPlace) - test(_TestStringTrimInPlaceWithAppend) - test(_TestStringIsNullTerminated) - test(_TestStringReplace) - test(_TestStringSplit) - test(_TestStringSplitBy) - test(_TestStringAdd) - test(_TestStringJoin) - test(_TestStringCount) - test(_TestStringCompare) - test(_TestStringContains) - test(_TestStringReadInt) - test(_TestStringUTF32) - test(_TestStringRFind) - test(_TestStringFromArray) - test(_TestStringFromIsoArray) - test(_TestStringSpace) - test(_TestStringRecalc) - test(_TestStringTruncate) - test(_TestStringChop) - test(_TestStringChopWithPush) - test(_TestStringUnchop) - test(_TestStringRepeatStr) - test(_TestStringConcatOffsetLen) - test(_TestStringFromCPointer) - test(_TestSpecialValuesF32) - test(_TestSpecialValuesF64) + test(_TestAddc) test(_TestArrayAppend) + test(_TestArrayChop) + test(_TestArrayChopWithPush) test(_TestArrayConcat) + test(_TestArrayFind) + test(_TestArrayFromCPointer) + test(_TestArrayInsert) test(_TestArraySlice) + test(_TestArraySwapElements) test(_TestArrayTrim) test(_TestArrayTrimInPlace) test(_TestArrayTrimInPlaceWithAppend) - test(_TestArrayInsert) - test(_TestArrayValuesRewind) - test(_TestArrayFind) - test(_TestArraySwapElements) - test(_TestArrayChop) - test(_TestArrayChopWithPush) test(_TestArrayUnchop) - test(_TestArrayFromCPointer) + test(_TestArrayValuesRewind) + test(_TestDivc) + test(_TestFld) + test(_TestFldc) + test(_TestFloatToString) + test(_TestIntToString) + test(_TestLambdaCapture) test(_TestMath128) - test(_TestRem) test(_TestMod) - test(_TestFld) - test(_TestAddc) - test(_TestSubc) + test(_TestModc) test(_TestMulc) - test(_TestDivc) - test(_TestFldc) + test(_TestNextPow2) + test(_TestNullablePointer) + test(_TestNumberConversionSaturation) + test(_TestRem) test(_TestRemc) - test(_TestModc) + test(_TestRotate) test(_TestSignedPartialArithmetic) + test(_TestSpecialValuesF32) + test(_TestSpecialValuesF64) + test(_TestStringAdd) + test(_TestStringChop) + test(_TestStringChopWithPush) + test(_TestStringCompare) + test(_TestStringConcatOffsetLen) + test(_TestStringContains) + test(_TestStringCount) + test(_TestStringCut) + test(_TestStringFromArray) + test(_TestStringFromCPointer) + test(_TestStringFromIsoArray) + test(_TestStringIsNullTerminated) + test(_TestStringJoin) + test(_TestStringLstrip) + test(_TestStringReadInt) + test(_TestStringRecalc) + test(_TestStringRemove) + test(_TestStringRepeatStr) + test(_TestStringReplace) + test(_TestStringRFind) + test(_TestStringRstrip) + test(_TestStringRunes) + test(_TestStringSpace) + test(_TestStringSplit) + test(_TestStringSplitBy) + test(_TestStringStrip) + test(_TestStringStripNonAscii) + test(_TestStringSubstring) + test(_TestStringToBool) + test(_TestStringToFloat) + test(_TestStringToI8) + test(_TestStringToIntLarge) + test(_TestStringToU8) + test(_TestStringTrim) + test(_TestStringTrimInPlace) + test(_TestStringTrimInPlaceWithAppend) + test(_TestStringTruncate) + test(_TestStringUnchop) + test(_TestStringUTF32) + test(_TestSubc) test(_TestUnsignedPartialArithmetic) - test(_TestNextPow2) - test(_TestNumberConversionSaturation) - test(_TestNullablePointer) - test(_TestLambdaCapture) test(_TestValtrace) fun @runtime_override_defaults(rto: RuntimeOptions) => diff --git a/packages/bureaucracy/_test.pony b/packages/bureaucracy/_test.pony index 79ebe47abb..7be4b3042c 100644 --- a/packages/bureaucracy/_test.pony +++ b/packages/bureaucracy/_test.pony @@ -5,6 +5,7 @@ actor Main is TestList new make() => None fun tag tests(test: PonyTest) => + // Tests below function across all systems and are listed alphabetically test(_TestCustodian) test(_TestRegistrar) diff --git a/packages/cli/_test.pony b/packages/cli/_test.pony index ed595a5cb8..30ebb39da4 100644 --- a/packages/cli/_test.pony +++ b/packages/cli/_test.pony @@ -5,30 +5,31 @@ actor Main is TestList new make() => None fun tag tests(test: PonyTest) => - test(_TestMinimal) - test(_TestMinimalWithHelp) + // Tests below function across all systems and are listed alphabetically test(_TestBadName) - test(_TestUnknownCommand) - test(_TestUnexpectedArg) - test(_TestUnknownShort) - test(_TestUnknownLong) - test(_TestHyphenArg) test(_TestBools) + test(_TestChat) test(_TestDefaults) - test(_TestShortsAdj) - test(_TestShortsEq) - test(_TestShortsNext) - test(_TestLongsEq) - test(_TestLongsNext) - test(_TestEnvs) - test(_TestOptionStop) test(_TestDuplicate) - test(_TestChat) - test(_TestMustBeLeaf) + test(_TestEnvs) test(_TestHelp) test(_TestHelpFalse) test(_TestHelpMultipleArgs) + test(_TestHyphenArg) + test(_TestLongsEq) + test(_TestLongsNext) + test(_TestMinimal) + test(_TestMinimalWithHelp) test(_TestMultipleEndOfOptions) + test(_TestMustBeLeaf) + test(_TestOptionStop) + test(_TestShortsAdj) + test(_TestShortsEq) + test(_TestShortsNext) + test(_TestUnexpectedArg) + test(_TestUnknownCommand) + test(_TestUnknownLong) + test(_TestUnknownShort) class iso _TestMinimal is UnitTest fun name(): String => "ponycli/minimal" diff --git a/packages/collections/_test.pony b/packages/collections/_test.pony index d68a811a4b..1ec53bf5c0 100644 --- a/packages/collections/_test.pony +++ b/packages/collections/_test.pony @@ -7,31 +7,32 @@ actor Main is TestList new make() => None fun tag tests(test: PonyTest) => + // Tests below function across all systems and are listed alphabetically + test(_TestFlags) + test(_TestHashSetContains) + test(_TestHashSetIntersect) + test(_TestHeap) test(_TestList) - test(_TestMap) - test(_TestMapRemove) - test(_TestMapUpsert) - test(_TestMapHashFunc) - test(_TestRing) - test(_TestListsFrom) - test(_TestListsMap) - test(_TestListsFlatMap) - test(_TestListsFilter) - test(_TestListsFold) + test(_TestListsContains) + test(_TestListsDrop) test(_TestListsEvery) test(_TestListsExists) + test(_TestListsFilter) + test(_TestListsFlatMap) + test(_TestListsFold) + test(_TestListsFrom) + test(_TestListsMap) test(_TestListsPartition) - test(_TestListsDrop) + test(_TestListsReverse) test(_TestListsTake) test(_TestListsTakeWhile) - test(_TestListsContains) - test(_TestListsReverse) - test(_TestHashSetContains) - test(_TestHashSetIntersect) - test(_TestSort) + test(_TestMap) + test(_TestMapHashFunc) + test(_TestMapRemove) + test(_TestMapUpsert) test(_TestRange) - test(_TestHeap) - test(_TestFlags) + test(_TestRing) + test(_TestSort) class iso _TestList is UnitTest fun name(): String => "collections/List" diff --git a/packages/collections/persistent/_test.pony b/packages/collections/persistent/_test.pony index eebe952c7e..8909688812 100644 --- a/packages/collections/persistent/_test.pony +++ b/packages/collections/persistent/_test.pony @@ -11,21 +11,22 @@ actor Main is TestList run_tests(test) fun tag run_tests(test: PonyTest) => - test(_TestListPrepend) - test(_TestListFrom) + // Tests below function across all systems and are listed alphabetically test(_TestListApply) - test(_TestListValues) test(_TestListConcat) - test(_TestListMap) - test(_TestListFlatMap) + test(_TestListDrop) + test(_TestListDropWhile) + test(_TestListEveryExists) test(_TestListFilter) + test(_TestListFlatMap) test(_TestListFold) - test(_TestListEveryExists) + test(_TestListFrom) + test(_TestListMap) test(_TestListPartition) - test(_TestListDrop) - test(_TestListDropWhile) + test(_TestListPrepend) test(_TestListTake) test(_TestListTakeWhile) + test(_TestListValues) test(_TestMap) test(_TestMapVsMap) test(_TestSet) diff --git a/packages/encode/base64/_test.pony b/packages/encode/base64/_test.pony index a5e42892b8..cd70e1cef4 100644 --- a/packages/encode/base64/_test.pony +++ b/packages/encode/base64/_test.pony @@ -6,8 +6,9 @@ actor Main is TestList new make() => None fun tag tests(test: PonyTest) => - test(_TestBase64Encode) + // Tests below function across all systems and are listed alphabetically test(_TestBase64Decode) + test(_TestBase64Encode) test(_TestBase64EncodeDecode) test(_TestBase64Quote) diff --git a/packages/files/_test.pony b/packages/files/_test.pony index 6683ed9011..d9b9c2e80d 100644 --- a/packages/files/_test.pony +++ b/packages/files/_test.pony @@ -13,54 +13,53 @@ actor Main is TestList new make() => None fun tag tests(test: PonyTest) => - test(_TestMkdtemp) - ifdef not windows then - test(_TestSymlink) - end - test(_TestWalk) - test(_TestFilePathFileAuth) - test(_TestFilePathFrom) - test(_TestFilePathFromError) - test(_TestDirectoryOpen) + // Tests below function across all systems and are listed alphabetically test(_TestDirectoryFileOpen) - test(_TestPathClean) - test(_TestPathJoin) - test(_TestPathRel) - test(_TestPathSplit) - test(_TestPathDir) - test(_TestPathBase) - test(_TestPathExt) - test(_TestPathVolume) - ifdef not windows then - test(_TestPathRoot) - end - test(_TestFileEOF) - test(_TestFileOpenError) + test(_TestDirectoryOpen) + test(_TestDirectoryRemoveReadOnly) test(_TestFileCreate) test(_TestFileCreateExistsNotWriteable) - ifdef not windows then - test(_TestFileCreateDirNotWriteable) - test(_TestFileOpenInDirNotWriteable) - test(_TestFileOpenPermissionDenied) - end test(_TestFileCreateMissingCaps) + test(_TestFileEOF) + test(_TestFileFlush) + test(_TestFileLinesEmptyFile) + test(_TestFileLinesMovingCursor) + test(_TestFileLinesMultiLine) + test(_TestFileLinesSingleLine) + test(_TestFileLongLine) + test(_TestFileMixedWriteQueue) test(_TestFileOpen) + test(_TestFileOpenError) test(_TestFileOpenWrite) - test(_TestFileLongLine) - test(_TestFileWrite) - test(_TestFileWritev) + test(_TestFilePathFileAuth) + test(_TestFilePathFrom) + test(_TestFilePathFromError) test(_TestFileQueue) test(_TestFileQueuev) - test(_TestFileMixedWriteQueue) - test(_TestFileWritevLarge) - test(_TestFileFlush) test(_TestFileReadMore) test(_TestFileRemoveReadOnly) - test(_TestDirectoryRemoveReadOnly) - test(_TestFileLinesEmptyFile) - test(_TestFileLinesSingleLine) - test(_TestFileLinesMultiLine) - test(_TestFileLinesMovingCursor) + test(_TestFileWrite) + test(_TestFileWritev) + test(_TestFileWritevLarge) + test(_TestMkdtemp) + test(_TestPathBase) + test(_TestPathClean) + test(_TestPathDir) + test(_TestPathExt) + test(_TestPathJoin) + test(_TestPathRel) + test(_TestPathSplit) + test(_TestPathVolume) + test(_TestWalk) + + // Tests below exclude windows and are listed alphabetically + ifdef not windows then + test(_TestFileCreateDirNotWriteable) + test(_TestFileOpenInDirNotWriteable) + test(_TestFileOpenPermissionDenied) + test(_TestPathRoot) + test(_TestSymlink) + end primitive _FileHelper fun make_files(h: TestHelper, files: Array[String]): FilePath ? => diff --git a/packages/format/_test.pony b/packages/format/_test.pony index a1817f08d6..4338106e66 100644 --- a/packages/format/_test.pony +++ b/packages/format/_test.pony @@ -6,6 +6,7 @@ actor Main is TestList new make() => None fun tag tests(test: PonyTest) => + // Tests below function across all systems and are listed alphabetically test(_TestApply) test(_TestInt) diff --git a/packages/ini/_test.pony b/packages/ini/_test.pony index e745bc1588..e5c16d49dc 100644 --- a/packages/ini/_test.pony +++ b/packages/ini/_test.pony @@ -5,6 +5,7 @@ actor Main is TestList new make() => None fun tag tests(test: PonyTest) => + // Tests below function across all systems and are listed alphabetically test(_TestIniParse) class iso _TestIniParse is UnitTest diff --git a/packages/itertools/_test.pony b/packages/itertools/_test.pony index 42bc1acdb1..4dc0654571 100644 --- a/packages/itertools/_test.pony +++ b/packages/itertools/_test.pony @@ -7,10 +7,10 @@ actor Main is TestList new make() => None fun tag tests(test: PonyTest) => - test(_TestIterChain) - test(_TestIterRepeatValue) + // Tests below function across all systems and are listed alphabetically test(_TestIterAll) test(_TestIterAny) + test(_TestIterChain) test(_TestIterCollect) test(_TestIterCount) test(_TestIterCycle) @@ -24,6 +24,7 @@ actor Main is TestList test(_TestIterMap) test(_TestIterNextOr) test(_TestIterNth) + test(_TestIterRepeatValue) test(_TestIterRun) test(_TestIterSkip) test(_TestIterSkipWhile) diff --git a/packages/json/_test.pony b/packages/json/_test.pony index 596029101f..5d573e32d6 100644 --- a/packages/json/_test.pony +++ b/packages/json/_test.pony @@ -6,25 +6,23 @@ actor Main is TestList new make() => None fun tag tests(test: PonyTest) => + // Tests below function across all systems and are listed alphabetically + test(_TestNoPrettyPrintArray) + test(_TestNoPrettyPrintObject) + test(_TestParseArray) test(_TestParseBasic) test(_TestParseKeyword) test(_TestParseNumber) - test(_TestParseString) - test(_TestParseArray) test(_TestParseObject) + test(_TestParsePrint) test(_TestParseRFC1) test(_TestParseRFC2) - + test(_TestParseString) + test(_TestPrintArray) test(_TestPrintKeyword) test(_TestPrintNumber) - test(_TestPrintString) - test(_TestPrintArray) test(_TestPrintObject) - - test(_TestNoPrettyPrintArray) - test(_TestNoPrettyPrintObject) - - test(_TestParsePrint) + test(_TestPrintString) class iso _TestParseBasic is UnitTest """ diff --git a/packages/logger/_test.pony b/packages/logger/_test.pony index fa6b965119..acb4e4a5b1 100644 --- a/packages/logger/_test.pony +++ b/packages/logger/_test.pony @@ -6,11 +6,12 @@ actor Main is TestList new make() => None fun tag tests(test: PonyTest) => + // Tests below function across all systems and are listed alphabetically test(_TestError) - test(_TestWarn) - test(_TestInfo) test(_TestFine) + test(_TestInfo) test(_TestObjectLogging) + test(_TestWarn) class iso _TestError is _StringLoggerTest fun name(): String => "logger/error" diff --git a/packages/math/_test.pony b/packages/math/_test.pony index 32d2fffa31..fcabee2122 100644 --- a/packages/math/_test.pony +++ b/packages/math/_test.pony @@ -6,17 +6,18 @@ actor Main is TestList new make() => None fun tag tests(test: PonyTest) => - test(_IsPrimeTestBuilder[U8]("U8")) + // Tests below function across all systems and are listed alphabetically + test(_IsPrimeTestBuilder[U128]("U128")) test(_IsPrimeTestBuilder[U16]("U16")) test(_IsPrimeTestBuilder[U32]("U32")) test(_IsPrimeTestBuilder[U64]("U64")) - test(_IsPrimeTestBuilder[U128]("U128")) + test(_IsPrimeTestBuilder[U8]("U8")) test(_IsPrimeTestBuilder[ULong]("ULong")) test(_IsPrimeTestBuilder[USize]("USize")) - test(_MersennePrimeTest[U8]("U8")) test(_MersennePrimeTest[U16]("U16")) test(_MersennePrimeTest[U32]("U32")) test(_MersennePrimeTest[U64]("U64")) + test(_MersennePrimeTest[U8]("U8")) test(_MersennePrimeTest[ULong]("ULong")) test(_MersennePrimeTest[USize]("USize")) diff --git a/packages/net/_test.pony b/packages/net/_test.pony index 9172118277..890c6b0cc4 100644 --- a/packages/net/_test.pony +++ b/packages/net/_test.pony @@ -6,21 +6,24 @@ actor Main is TestList new make() => None fun tag tests(test: PonyTest) => - ifdef not osx then - test(_TestBroadcast) - end - test(_TestTCPWritev) + // Tests below function across all systems and are listed alphabetically + test(_TestTCPConnectionFailed) test(_TestTCPExpect) test(_TestTCPExpectOverBufferSize) test(_TestTCPMute) + test(_TestTCPProxy) test(_TestTCPUnmute) + test(_TestTCPWritev) + + // Tests below exclude windows and are listed alphabetically ifdef not windows then + test(_TestTCPConnectionToClosedServerFailed) test(_TestTCPThrottle) end - test(_TestTCPProxy) - test(_TestTCPConnectionFailed) - ifdef not windows then - test(_TestTCPConnectionToClosedServerFailed) + + // Tests below exclude osx and are listed alphabetically + ifdef not osx then + test(_TestBroadcast) end class _TestPing is UDPNotify diff --git a/packages/process/_test.pony b/packages/process/_test.pony index f1e7c1a699..16e0374b83 100644 --- a/packages/process/_test.pony +++ b/packages/process/_test.pony @@ -12,20 +12,21 @@ actor Main is TestList new make() => None fun tag tests(test: PonyTest) => + // Tests below function across all systems and are listed alphabetically + test(_TestBadChdir) + test(_TestBadExec) + test(_TestChdir) + test(_TestExpect) test(_TestFileExecCapabilityIsRequired) + test(_TestKillLongRunningChild) + test(_TestLongRunningChild) test(_TestNonExecutablePathResultsInExecveError) - test(_TestStdinStdout) - test(_TestStderr) - test(_TestExpect) - test(_TestWritevOrdering) test(_TestPrintvOrdering) + test(_TestStderr) + test(_TestStdinStdout) test(_TestStdinWriteBuf) - test(_TestChdir) - test(_TestBadChdir) - test(_TestBadExec) - test(_TestLongRunningChild) - test(_TestKillLongRunningChild) test(_TestWaitingOnClosedProcessTwice) + test(_TestWritevOrdering) class _PathResolver let _path: Array[FilePath] val diff --git a/packages/promises/_test.pony b/packages/promises/_test.pony index 36f58d5111..2a47d06652 100644 --- a/packages/promises/_test.pony +++ b/packages/promises/_test.pony @@ -6,16 +6,17 @@ actor Main is TestList new make() => None fun tag tests(test: PonyTest) => + // Tests below function across all systems and are listed alphabetically + test(_TestFlattenNextFirstHasFulfillError) + test(_TestFlattenNextHappyPath) + test(_TestFlattenNextRejectFirst) + test(_TestFlattenNextSecondHasFulfillError) test(_TestPromise) test(_TestPromiseAdd) test(_TestPromiseSelect) - test(_TestPromiseTimeout) test(_TestPromisesJoin) test(_TestPromisesJoinThenReject) - test(_TestFlattenNextHappyPath) - test(_TestFlattenNextFirstHasFulfillError) - test(_TestFlattenNextSecondHasFulfillError) - test(_TestFlattenNextRejectFirst) + test(_TestPromiseTimeout) class iso _TestPromise is UnitTest fun name(): String => "promises/Promise" diff --git a/packages/random/_test.pony b/packages/random/_test.pony index b0094c948b..5fbaa023a9 100644 --- a/packages/random/_test.pony +++ b/packages/random/_test.pony @@ -6,11 +6,12 @@ actor Main is TestList new make() => None fun tag tests(test: PonyTest) => + // Tests below function across all systems and are listed alphabetically test(_TestMT) test(_TestRandomShuffle) test(_TestSplitMix64) - test(_TestXorOshiro128StarStar) test(_TestXorOshiro128Plus) + test(_TestXorOshiro128StarStar) test(_TestXorShift128Plus) class iso _TestMT is UnitTest diff --git a/packages/serialise/_test.pony b/packages/serialise/_test.pony index 534923b3b6..395763bb78 100644 --- a/packages/serialise/_test.pony +++ b/packages/serialise/_test.pony @@ -12,10 +12,11 @@ actor Main is TestList no pointers no actors */ - test(_TestSimple) + // Tests below function across all systems and are listed alphabetically test(_TestArrays) - test(_TestFailures) test(_TestBoxedMachineWord) + test(_TestFailures) + test(_TestSimple) class _MachineWords var bool1: Bool = true diff --git a/packages/stdlib/_test.pony b/packages/stdlib/_test.pony index b170568cc4..43bc59e2b6 100644 --- a/packages/stdlib/_test.pony +++ b/packages/stdlib/_test.pony @@ -49,6 +49,7 @@ actor Main is TestList new make() => None fun tag tests(test: PonyTest) => + // Tests below function across all systems and are listed alphabetically base64.Main.make().tests(test) builtin_test.Main.make().tests(test) buffered.Main.make().tests(test) @@ -68,15 +69,15 @@ actor Main is TestList promises.Main.make().tests(test) random.Main.make().tests(test) serialise.Main.make().tests(test) + strings.Main.make().tests(test) + time.Main.make().tests(test) + // Tests below function exclude windows and are listed alphabetically ifdef not windows then // The signals tests currently abort the process on Windows, so ignore // them. signals.Main.make().tests(test) end - strings.Main.make().tests(test) - time.Main.make().tests(test) - fun @runtime_override_defaults(rto: RuntimeOptions) => rto.ponynoblock = true diff --git a/packages/strings/_test.pony b/packages/strings/_test.pony index c4eb3604e6..5cfb799930 100644 --- a/packages/strings/_test.pony +++ b/packages/strings/_test.pony @@ -5,6 +5,7 @@ actor Main is TestList new make() => None fun tag tests(test: PonyTest) => + // Tests below function across all systems and are listed alphabetically test(_TestStringsCommonPrefix) class iso _TestStringsCommonPrefix is UnitTest diff --git a/packages/time/_test.pony b/packages/time/_test.pony index d13d8fff43..79702e4c3e 100644 --- a/packages/time/_test.pony +++ b/packages/time/_test.pony @@ -5,6 +5,7 @@ actor Main is TestList new make() => None fun tag tests(test: PonyTest) => + // Tests below function across all systems and are listed alphabetically test(_TestNanos) test(_TestPosixDate) From 76d5353fa09fb7663f29ca9a3e3b223c32864167 Mon Sep 17 00:00:00 2001 From: Ryan Hagenson Date: Wed, 15 Sep 2021 20:03:14 -0500 Subject: [PATCH 2/7] Reorder based on type --- packages/math/_test.pony | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/math/_test.pony b/packages/math/_test.pony index fcabee2122..115cbc9c0d 100644 --- a/packages/math/_test.pony +++ b/packages/math/_test.pony @@ -7,17 +7,17 @@ actor Main is TestList fun tag tests(test: PonyTest) => // Tests below function across all systems and are listed alphabetically - test(_IsPrimeTestBuilder[U128]("U128")) + test(_IsPrimeTestBuilder[U8]("U8")) test(_IsPrimeTestBuilder[U16]("U16")) test(_IsPrimeTestBuilder[U32]("U32")) test(_IsPrimeTestBuilder[U64]("U64")) - test(_IsPrimeTestBuilder[U8]("U8")) + test(_IsPrimeTestBuilder[U128]("U128")) test(_IsPrimeTestBuilder[ULong]("ULong")) test(_IsPrimeTestBuilder[USize]("USize")) + test(_MersennePrimeTest[U8]("U8")) test(_MersennePrimeTest[U16]("U16")) test(_MersennePrimeTest[U32]("U32")) test(_MersennePrimeTest[U64]("U64")) - test(_MersennePrimeTest[U8]("U8")) test(_MersennePrimeTest[ULong]("ULong")) test(_MersennePrimeTest[USize]("USize")) From 88f5628e2d8a9b5cef8940e3e7b181c8c53336c9 Mon Sep 17 00:00:00 2001 From: Ryan Hagenson Date: Wed, 15 Sep 2021 20:44:13 -0500 Subject: [PATCH 3/7] Add test ordering rules --- STYLE_GUIDE.md | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/STYLE_GUIDE.md b/STYLE_GUIDE.md index 3fd7179081..bbf420eaac 100644 --- a/STYLE_GUIDE.md +++ b/STYLE_GUIDE.md @@ -593,3 +593,72 @@ Single line comments will have exactly one space between the `//` token and the // to coalesce multiple tiny arrays // into a single bigger array ``` + +## Testing + +### Ordering + +Tests should be ordered alphabetically (within reason) separated into sections based on system inclusion/exclusion criteria. First, list tests that run on all systems, next list tests which include/exclude one system, and lastly list tests which include/exclude more than one system. + +```pony +actor Main is TestList + new create(env: Env) => PonyTest(env, this) + new make() => None + + fun tag tests(test: PonyTest) => + // Tests below include all systems and are listed alphabetically + test(_TestOnAllSystemsA) + test(_TestOnAllSystemsB) + test(_TestOnAllSystemsC) + + // Tests below include only windows and are listed alphabetically + ifdef windows then + test(_TestOnWindowsA) + test(_TestOnWindowsB) + test(_TestOnWindowsC) + end + + // Tests below exclude windows and are listed alphabetically + ifdef not windows then + test(_TestOnAllSystemsExceptWindowsA) + test(_TestOnAllSystemsExceptWindowsB) + test(_TestOnAllSystemsExceptWindowsC) + end + + // Tests below include only osx and are listed alphabetically + ifdef osx then + test(_TestOnOsxA) + test(_TestOnOsxB) + test(_TestOnOsxC) + end + + // Tests below exclude osx and are listed alphabetically + ifdef not osx then + test(_TestOnAllSystemsExceptOsxA) + test(_TestOnAllSystemsExceptOsxB) + test(_TestOnAllSystemsExceptOsxC) + end + + // Tests below exclude windows/osx and are listed alphabetically + ifdef not windows or not osx then + test(_TestOnAllSystemsExceptWindowsOrOsxA) + test(_TestOnAllSystemsExceptWindowsOrOsxB) + test(_TestOnAllSystemsExceptWindowsOrOsxC) + end +``` + +It can sometimes make more sense to not use alphabetical ordering -- such as when using a generic test builder -- in such circumstances breaking alphabetical ordering is allowed. + +```pony +actor Main is TestList + new create(env: Env) => PonyTest(env, this) + new make() => None + + fun tag tests(test: PonyTest) => + // Tests below include all systems and are listed alphabetically + test(_TestOnAllSystemsWithBuilder[U8]()) + test(_TestOnAllSystemsWithBuilder[U16]()) + test(_TestOnAllSystemsWithBuilder[U32]()) + test(_TestOnAllSystemsWithBuilder[U64]()) + test(_TestOnAllSystemsWithBuilder[U128]()) +``` From 3a4ae97b6e54108c161e0833fb40755683b9cd5e Mon Sep 17 00:00:00 2001 From: Ryan Hagenson Date: Thu, 16 Sep 2021 18:42:11 -0500 Subject: [PATCH 4/7] Fix ill-suited comment on order --- STYLE_GUIDE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/STYLE_GUIDE.md b/STYLE_GUIDE.md index bbf420eaac..be775371ec 100644 --- a/STYLE_GUIDE.md +++ b/STYLE_GUIDE.md @@ -655,7 +655,7 @@ actor Main is TestList new make() => None fun tag tests(test: PonyTest) => - // Tests below include all systems and are listed alphabetically + // Tests below include all systems and are listed in increasing type argument size test(_TestOnAllSystemsWithBuilder[U8]()) test(_TestOnAllSystemsWithBuilder[U16]()) test(_TestOnAllSystemsWithBuilder[U32]()) From adb7da826ec0b638fba4150778852117b208d11b Mon Sep 17 00:00:00 2001 From: Ryan Hagenson Date: Mon, 4 Oct 2021 19:04:18 -0500 Subject: [PATCH 5/7] Update ordering and systems->platforms renaming --- STYLE_GUIDE.md | 53 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 37 insertions(+), 16 deletions(-) diff --git a/STYLE_GUIDE.md b/STYLE_GUIDE.md index be775371ec..c769b3b554 100644 --- a/STYLE_GUIDE.md +++ b/STYLE_GUIDE.md @@ -598,7 +598,7 @@ Single line comments will have exactly one space between the `//` token and the ### Ordering -Tests should be ordered alphabetically (within reason) separated into sections based on system inclusion/exclusion criteria. First, list tests that run on all systems, next list tests which include/exclude one system, and lastly list tests which include/exclude more than one system. +Tests should be ordered alphabetically (within reason) separated into sections based on platform inclusion/exclusion criteria. First, list tests that run on all platforms, next list tests which include/exclude one platform, and lastly list tests which include/exclude multiple platforms. Sections should have an increasing number of inclusions/exclusions therefore if you have a section including only one platform, the next section should be tests excluding only that platform. When considering multiple platforms, list them alphabetically whether considering between sections or within sections. The set of known platforms recognized by `ifdef` can be found in `Platform` within `builtin`. ```pony actor Main is TestList @@ -611,18 +611,18 @@ actor Main is TestList test(_TestOnAllSystemsB) test(_TestOnAllSystemsC) - // Tests below include only windows and are listed alphabetically - ifdef windows then - test(_TestOnWindowsA) - test(_TestOnWindowsB) - test(_TestOnWindowsC) + // Tests below include only bsd and are listed alphabetically + ifdef bsd then + test(_TestOnBsdA) + test(_TestOnBsdB) + test(_TestOnBsdC) end - // Tests below exclude windows and are listed alphabetically - ifdef not windows then - test(_TestOnAllSystemsExceptWindowsA) - test(_TestOnAllSystemsExceptWindowsB) - test(_TestOnAllSystemsExceptWindowsC) + // Tests below exclude bsd and are listed alphabetically + ifdef not bsd then + test(_TestOnAllSystemsExceptBsdA) + test(_TestOnAllSystemsExceptBsdB) + test(_TestOnAllSystemsExceptBsdC) end // Tests below include only osx and are listed alphabetically @@ -639,11 +639,32 @@ actor Main is TestList test(_TestOnAllSystemsExceptOsxC) end - // Tests below exclude windows/osx and are listed alphabetically - ifdef not windows or not osx then - test(_TestOnAllSystemsExceptWindowsOrOsxA) - test(_TestOnAllSystemsExceptWindowsOrOsxB) - test(_TestOnAllSystemsExceptWindowsOrOsxC) + // Tests below include only windows and are listed alphabetically + ifdef windows then + test(_TestOnWindowsA) + test(_TestOnWindowsB) + test(_TestOnWindowsC) + end + + // Tests below exclude windows and are listed alphabetically + ifdef not windows then + test(_TestOnAllSystemsExceptWindowsA) + test(_TestOnAllSystemsExceptWindowsB) + test(_TestOnAllSystemsExceptWindowsC) + end + + // Tests below exclude osx/windows and are listed alphabetically + ifdef not osx or not windows then + test(_TestOnAllSystemsExceptOsxOrWindowsA) + test(_TestOnAllSystemsExceptOsxOrWindowsB) + test(_TestOnAllSystemsExceptOsxOrWindowsC) + end + + // Tests below exclude bsd/osx/windows and are listed alphabetically + ifdef not bsd or not osx or not windows then + test(_TestOnAllSystemsExceptBsdOrOsxOrWindowsA) + test(_TestOnAllSystemsExceptBsdOrOsxOrWindowsB) + test(_TestOnAllSystemsExceptBsdOrOsxOrWindowsC) end ``` From 5b4bac42ce9338eafb73f3b122d85ae73963dcc2 Mon Sep 17 00:00:00 2001 From: Ryan Hagenson Date: Mon, 4 Oct 2021 19:08:27 -0500 Subject: [PATCH 6/7] Add bsd/windows exclusion section --- STYLE_GUIDE.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/STYLE_GUIDE.md b/STYLE_GUIDE.md index c769b3b554..2ea9642925 100644 --- a/STYLE_GUIDE.md +++ b/STYLE_GUIDE.md @@ -598,7 +598,7 @@ Single line comments will have exactly one space between the `//` token and the ### Ordering -Tests should be ordered alphabetically (within reason) separated into sections based on platform inclusion/exclusion criteria. First, list tests that run on all platforms, next list tests which include/exclude one platform, and lastly list tests which include/exclude multiple platforms. Sections should have an increasing number of inclusions/exclusions therefore if you have a section including only one platform, the next section should be tests excluding only that platform. When considering multiple platforms, list them alphabetically whether considering between sections or within sections. The set of known platforms recognized by `ifdef` can be found in `Platform` within `builtin`. +Tests should be ordered alphabetically (within reason) separated into sections based on platform inclusion/exclusion criteria. First, list tests that run on all platforms, next list tests which include/exclude one platform, and lastly list tests which include/exclude multiple platforms. Sections should have an increasing number of inclusions/exclusions therefore if you have a section including only one platform, the next section should be tests excluding only that platform. When considering multiple platforms, list them alphabetically between sections and within sections. The set of known platforms recognized by `ifdef` can be found in `Platform` within `builtin`. ```pony actor Main is TestList @@ -653,6 +653,13 @@ actor Main is TestList test(_TestOnAllSystemsExceptWindowsC) end + // Tests below exclude bsd/windows and are listed alphabetically + ifdef not bsd or not windows then + test(_TestOnAllSystemsExceptBsdOrWindowsA) + test(_TestOnAllSystemsExceptBsdOrWindowsB) + test(_TestOnAllSystemsExceptBsdOrWindowsC) + end + // Tests below exclude osx/windows and are listed alphabetically ifdef not osx or not windows then test(_TestOnAllSystemsExceptOsxOrWindowsA) From 5aa6d8f241b391cc7ef4b34c86abd917ee69d24f Mon Sep 17 00:00:00 2001 From: Ryan Hagenson Date: Mon, 4 Oct 2021 19:15:10 -0500 Subject: [PATCH 7/7] Sort tests in builtin and docs --- packages/ponytest/ponytest.pony | 4 ++-- packages/stdlib/_test.pony | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/ponytest/ponytest.pony b/packages/ponytest/ponytest.pony index c3bc2f9478..f977306179 100644 --- a/packages/ponytest/ponytest.pony +++ b/packages/ponytest/ponytest.pony @@ -93,8 +93,8 @@ tests from packages `foo` and `bar`. ```pony use "ponytest" -use foo = "foo" use bar = "bar" +use foo = "foo" actor Main is TestList new create(env: Env) => @@ -104,8 +104,8 @@ actor Main is TestList None fun tag tests(test: PonyTest) => - foo.Main.make().tests(test) bar.Main.make().tests(test) + foo.Main.make().tests(test) ``` Aggregate test classes may themselves be aggregated. Every test list class may diff --git a/packages/stdlib/_test.pony b/packages/stdlib/_test.pony index 43bc59e2b6..f9afcc973a 100644 --- a/packages/stdlib/_test.pony +++ b/packages/stdlib/_test.pony @@ -51,8 +51,8 @@ actor Main is TestList fun tag tests(test: PonyTest) => // Tests below function across all systems and are listed alphabetically base64.Main.make().tests(test) - builtin_test.Main.make().tests(test) buffered.Main.make().tests(test) + builtin_test.Main.make().tests(test) bureaucracy.Main.make().tests(test) cli.Main.make().tests(test) collections.Main.make().tests(test)