Skip to content

Commit 4218bef

Browse files
committed
date
1 parent 6f25323 commit 4218bef

1 file changed

Lines changed: 72 additions & 0 deletions

File tree

docs-src/blog/2026-05-19-string-counterstring-domain-method.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,78 @@ slug: string-counterstring-domain-method
33
title: "Added string.counterString to Domain Test Data"
44
authors: [alan]
55
tags: [release, test-data, domain]
6+
date: 2026-05-20T10:30
7+
---
8+
9+
`string.counterString` is now available in the domain model.
10+
11+
This is the first `string.*` domain addition that is not backed directly by Faker, and is implemented as a custom domain delegate.
12+
13+
<!-- truncate -->
14+
15+
## Why add it?
16+
17+
Counterstrings are useful for field-length and truncation testing because each marker shows its position in the generated text.
18+
19+
Example pattern:
20+
21+
`*3*5*7*9*12*15*`
22+
23+
If we entered the above into a field that truncated to 14 we would see:
24+
25+
`*3*5*7*9*12*15` - this looks incorrect because I'm expecting to see a number before an `*`, if I see a number without an `*` then I know there has been some truncation.
26+
27+
## Usage
28+
29+
`string.counterString(min, max, delimiter="*")`
30+
31+
- If only one integer is supplied, it is used as both min and max.
32+
- If two integers are supplied, the lower value is used as min and the higher as max.
33+
- Lowest allowed min is `1`.
34+
- Delimiter defaults to `*`.
35+
- If a delimiter longer than one character is passed, only the first character is used.
36+
37+
Examples:
38+
39+
```txt
40+
Fixed15
41+
string.counterString(15)
42+
```
43+
44+
```txt
45+
Range5to12
46+
string.counterString(min=5, max=12)
47+
```
48+
49+
```txt
50+
HashDelimited
51+
string.counterString(12, 12, "#")
52+
```
53+
54+
## Take Care
55+
56+
We've added no limits to the length of the counterstrings to take care in your definitions. Sure you can create 1,000,000 rows with counterstrings that are 1,000,000 characters long, but I'm not sure if your computer is going to like generating that.
57+
58+
We default to a `1-25` character counterstring to mitigate this risk somewhat.
59+
60+
## Other counterstring resources
61+
62+
If you are interested in using CounterStrings in your testing then checkout this Chrome extension:
63+
64+
- https://www.eviltester.com/page/tools/counterstringjs/
65+
66+
It allows you to generate counterstrings and other data directly into the browser fields.
67+
68+
Also more information about CounterStrings here:
69+
70+
- https://www.satisfice.com/blog/archives/22
71+
- https://www.eviltester.com/blog/eviltester/news/counterstring-new-version-dec-2025/
72+
- https://www.eviltester.com/categories/counterstrings/
73+
---
74+
slug: string-counterstring-domain-method
75+
title: "Added string.counterString to Domain Test Data"
76+
authors: [alan]
77+
tags: [release, test-data, domain]
678
---
779

880
`string.counterString` is now available in the domain model.

0 commit comments

Comments
 (0)