chore: reorganize test files into domain-specific subdirectories
- Moved unit tests for user authentication into `tests/unit/auth/` - Relocated integration tests for payment processing to `tests/integration/payments/` - Grouped API endpoint tests under `tests/api/` with separate files for each resource - Updated test runner configuration to discover tests in new directory structure
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
io.write("".contains("")) // expect: true
|
||||
io.write("anything".contains("")) // expect: true
|
||||
io.write("something".contains("meth")) // expect: true
|
||||
io.write("something".contains("some")) // expect: true
|
||||
io.write("something".contains("ing")) // expect: true
|
||||
io.write("something".contains("math")) // expect: false
|
||||
|
||||
// TODO(bob): Passing non-string as argument.
|
||||
@@ -0,0 +1,2 @@
|
||||
io.write("".count) // expect: 0
|
||||
io.write("a string".count) // expect: 8
|
||||
@@ -0,0 +1,19 @@
|
||||
io.write("" == "") // expect: true
|
||||
io.write("abcd" == "abcd") // expect: true
|
||||
io.write("abcd" == "d") // expect: false
|
||||
io.write("e" == "abcd") // expect: false
|
||||
io.write("" == "abcd") // expect: false
|
||||
|
||||
// Not equal to other types.
|
||||
io.write("1" == 1) // expect: false
|
||||
io.write("true" == true) // expect: false
|
||||
|
||||
io.write("" != "") // expect: false
|
||||
io.write("abcd" != "abcd") // expect: false
|
||||
io.write("abcd" != "d") // expect: true
|
||||
io.write("e" != "abcd") // expect: true
|
||||
io.write("" != "abcd") // expect: true
|
||||
|
||||
// Not equal to other types.
|
||||
io.write("1" != 1) // expect: true
|
||||
io.write("true" != true) // expect: true
|
||||
@@ -0,0 +1,8 @@
|
||||
// Escape characters.
|
||||
io.write("\"") // expect: "
|
||||
io.write("\\") // expect: \
|
||||
io.write("(\n)") // expect: (
|
||||
// expect: )
|
||||
|
||||
// TODO(bob): Non-printing escapes like \t.
|
||||
// TODO(bob): Unicode escape sequences.
|
||||
@@ -0,0 +1,2 @@
|
||||
io.write("".count) // expect: 0
|
||||
io.write("a string") // expect: a string
|
||||
@@ -0,0 +1,24 @@
|
||||
// Returns characters (as strings).
|
||||
io.write("abcd"[0]) // expect: a
|
||||
io.write("abcd"[1]) // expect: b
|
||||
io.write("abcd"[2]) // expect: c
|
||||
io.write("abcd"[3]) // expect: d
|
||||
|
||||
// Allows indexing backwards from the end.
|
||||
io.write("abcd"[-4]) // expect: a
|
||||
io.write("abcd"[-3]) // expect: b
|
||||
io.write("abcd"[-2]) // expect: c
|
||||
io.write("abcd"[-1]) // expect: d
|
||||
|
||||
// Handle out of bounds.
|
||||
// TODO(bob): Should halt the fiber or raise an error somehow.
|
||||
io.write("abcd"[4]) // expect: null
|
||||
io.write("abcd"[-5]) // expect: null
|
||||
|
||||
// Handle wrong argument type.
|
||||
// TODO(bob): Should halt the fiber or raise an error somehow.
|
||||
io.write("abcd"[true]) // expect: null
|
||||
|
||||
// Handle non-integer index.
|
||||
// TODO(bob): Should halt the fiber or raise an error somehow.
|
||||
io.write("abcd"[1.5]) // expect: null
|
||||
@@ -0,0 +1,2 @@
|
||||
io.write("".toString == "") // expect: true
|
||||
io.write("blah".toString == "blah") // expect: true
|
||||
@@ -0,0 +1,4 @@
|
||||
io.write("s" is String) // expect: true
|
||||
io.write("s" is Object) // expect: true
|
||||
io.write("s" is Num) // expect: false
|
||||
io.write("s".type == String) // expect: true
|
||||
Reference in New Issue
Block a user