You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* ⌨️ Optimize `nginx` line spacing
* Fix misc go change
* 🐍 Python spacing, misc flow
I like adding some space to seperate out the caller base object with the local variable for ease of visual parsing
* 🤖 ran the prettier script
* 🐜 pass compilation checks (sync)
Copy file name to clipboardExpand all lines: docs/build/guides/testing/unit-tests.mdx
+9-2Lines changed: 9 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ Unit tests are small tests that test one piece of functionality within a contrac
9
9
10
10
## How to Write Unit Tests
11
11
12
-
The following is an example of a unit test, written to test the [increment contract]. The contract has an `increment` function, that increases a counter value by one on every invocation. The following test invokes that contract's function several times, and checks that the value increases by one.
12
+
The following is an example of a unit test, written to test the [increment contract](https://github.com/stellar/soroban-examples/blob/main/increment/src/lib.rs). The contract has an `increment` function, that increases a counter value by one on every invocation. The following test invokes that contract's function several times, and checks that the value increases by one.
13
13
14
14
```rust
15
15
#![cfg(test)]
@@ -71,4 +71,11 @@ The `Env` created at the beginning of the test is not a simulation of the Soroba
It's a simple test, but it's a complete test. There's a full environment setup, used, and torn down in the test, and it happens fast. The Rust test harness runs all the tests for a contract in parallel and each will have its own isolated contract environment.
75
+
76
+
Most tests, even integration tests and fuzz tests, will look very similar to this unit test. They'll do four things:
0 commit comments