Add assert-related testing functions, findFirst/findFirstOrNull methods, and expand documentation.

This commit is contained in:
sergeych committed 2025-12-21 19:11:37 +01:00
1 parent 99f883cfc7
commit 3ac7fd7ceb
8 files changed
+193 -16

No files matched your search

+6 -1
View File
@@ -9,6 +9,7 @@ __Other documents to read__ maybe after this one:
- [Advanced topics](advanced_topics.md), [declaring arguments](declaring_arguments.md), [Scopes and Closures](scopes_and_closures.md)
- [OOP notes](OOP.md), [exception handling](exceptions_handling.md)
- [math in Lyng](math.md), [the `when` statement](when.md)
- [Testing and Assertions](Testing.md)
- [time](time.md) and [parallelism](parallelism.md)
- [parallelism] - multithreaded code, coroutines, etc.
- Some class
@@ -329,7 +330,7 @@ will be thrown:
// WRONG! Exception will be thrown at next line:
foo + "bar"
Correct pattern is:
The correct pattern is:
foo = "foo"
// now is OK:
@@ -478,6 +479,8 @@ one could be with ellipsis that means "the rest pf arguments as List":
### Using lambda as the parameter
See also: [Testing and Assertions](Testing.md)
// note that fun returns its last calculated value,
// in our case, result after in-place addition:
fun mapValues(iterable, transform) {
@@ -1466,6 +1469,8 @@ Lambda avoid unnecessary execution if assertion is not failed. for example:
[List]: List.md
[Testing]: Testing.md
[Iterable]: Iterable.md
[Iterator]: Iterator.md