Skip to content

Commit c777d2e

Browse files
committed
2 parents b5da92d + 0f5f1e9 commit c777d2e

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

README.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,26 @@ The virtual machines in this section are SECD-style and follow a description in
5858
* [`src/module-demos/bohemian.js`](https://tinyurl.com/SICPJS-rhapsody): Bohemian Rhapsody cover using the "sounds" library
5959
* [`src/module-demos/pix-n-flix.js`](https://tinyurl.com/SICP-distortion): a library for image and video processing, based on the constituent pixels
6060

61-
## Test
61+
## Test framework
6262
* [`src/test/framework/main.js`](https://github.com/source-academy/source-programs/blob/master/src/test/framework/): test framework for Source programs, written in Source §4
6363

64-
### License
64+
# Testing
65+
66+
Write your test cases in the folder `__tests__` in each `src` subfolder. The name of the file specifies the targeted Source.
67+
For example, `src/steppers/source-0.js` is the Source and a test case might be `src/steppers/__tests__/source-0.js.test1`.
68+
69+
Each test case is appended to your Source, and then run, using Source §4. The last line of the test case is a comment that must contain the expected result. For example, a stepper test case may be:
70+
```
71+
parse_and_evaluate("! (1 === 1 && 2 > 3);");
72+
// true
73+
```
74+
75+
Run all test cases by typing:
76+
```
77+
% yarn test
78+
```
79+
80+
# License
6581

6682
[![GPL 3][gpl3-image]][gpl3]
6783
All JavaScript programs in this repository are licensed under the

0 commit comments

Comments
 (0)