Skip to content

Commit e5f2dec

Browse files
committed
List all custom assertions in submodule readme
This allows you to click on the sub-package on code.dlang.org and get a list. This is something have now done a few times (instinctively, the affordance is definitely there for it) but I never found anything and had to go source diving for the functions. Extracted with the following commands from the git root dir: ``` PATTERN='^\s*(?:[A-Za-z_@()\s]*\s)?(?:auto|void)\s+(should[A-Z][A-Za-z_0-9]*)' FILE=subpackages/assertions/source/unit_threaded/assertions.d rg -P --no-line-number --only-matching --replace '$1' "$PATTERN" "$FILE" \ | awk '!seen[$0]++' \ | sed 's/^/- /' ```
1 parent 052b43f commit e5f2dec

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

subpackages/assertions/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
This module contains the following assertions:
2+
3+
- shouldBeTrue
4+
- shouldBeFalse
5+
- shouldEqual
6+
- shouldNotEqual
7+
- shouldBeNull
8+
- shouldNotBeNull
9+
- shouldBeIn
10+
- shouldNotBeIn
11+
- shouldThrow
12+
- shouldThrowExactly
13+
- shouldNotThrow
14+
- shouldThrowWithMessage
15+
- shouldApproxEqual
16+
- shouldBeEmpty
17+
- shouldNotBeEmpty
18+
- shouldBeGreaterThan
19+
- shouldBeSmallerThan
20+
- shouldBeSameSetAs
21+
- shouldNotBeSameSetAs
22+
- shouldBeSameJsonAs
23+
- shouldBeBetween
24+
- shouldApprox
25+
26+
It also contains the `should` -testing DSL. I.e.:
27+
```
28+
1.should == 1;
29+
1.should.not == 2;
30+
1.should in [1, 2, 3];
31+
4.should.not in [1, 2, 3];
32+
```

0 commit comments

Comments
 (0)