refactor: move benchmark directory under test and update all references
The benchmark directory is relocated from the project root into the test directory, and all scripts, documentation links, and gitignore paths are updated accordingly. The test runner is also refactored to explicitly walk subdirectories (core, io, language, limit) instead of using a single test root, and a new test/README.md is added to document the test suite structure. Additionally, the constructor test for the Foo class is updated to add a zero-arity constructor and adjust expected output strings.
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
var a = {"one": 1, "two": 2, "three": 3, "four": 4}.values
|
||||
|
||||
// The precise numeric values aren't defined since they are indexes into the
|
||||
// entry table and the hashing process isn't specified. So we just validate
|
||||
// what we can assume about them.
|
||||
|
||||
IO.print(a.iterate(null) is Num) // expect: true
|
||||
IO.print(a.iterate(null) >= 0) // expect: true
|
||||
|
||||
IO.print(a.iterate(0) is Num) // expect: true
|
||||
IO.print(a.iterate(0) > 0) // expect: true
|
||||
IO.print(a.iterate(1) is Num) // expect: true
|
||||
IO.print(a.iterate(1) > 0) // expect: true
|
||||
IO.print(a.iterate(2) is Num) // expect: true
|
||||
IO.print(a.iterate(2) > 0) // expect: true
|
||||
IO.print(a.iterate(3) is Num) // expect: true
|
||||
IO.print(a.iterate(3) > 0) // expect: true
|
||||
|
||||
var previous = -1
|
||||
var iterator = a.iterate(null)
|
||||
while (iterator) {
|
||||
IO.print(iterator > previous)
|
||||
IO.print(iterator is Num)
|
||||
previous = iterator
|
||||
iterator = a.iterate(iterator)
|
||||
}
|
||||
// First entry:
|
||||
// expect: true
|
||||
// expect: true
|
||||
// Second entry:
|
||||
// expect: true
|
||||
// expect: true
|
||||
// Third entry:
|
||||
// expect: true
|
||||
// expect: true
|
||||
// Fourth entry:
|
||||
// expect: true
|
||||
// expect: true
|
||||
|
||||
// Out of bounds.
|
||||
IO.print(a.iterate(16)) // expect: false
|
||||
IO.print(a.iterate(-1)) // expect: false
|
||||
|
||||
// Nothing to iterate in an empty map.
|
||||
IO.print({}.values.iterate(null)) // expect: false
|
||||
Reference in New Issue
Block a user