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
Copy file name to clipboardExpand all lines: README.md
+17-17Lines changed: 17 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ The pattern is as follows:
27
27
### Groups
28
28
-`(\d){5}` - Five digits between 0 and 9.
29
29
-`\L(\d){3}\L` - A upper-case letter, five digits between 0 and 9 and another upper-case letter.
30
-
-`(.[100-101]){3}` - Three items, each will include a dot '.' and either 100 or 101 e.g. *'.100.100.100'*
30
+
-`(.[100-101]){3}` - Three items, each will include a dot '.' and either 100 or 101 e.g. *'.100.101.101'*
31
31
32
32
### Ranges
33
33
-`[a-z]` - A single lower-case letter between a and z.
@@ -46,7 +46,7 @@ The pattern is as follows:
46
46
47
47
### Named Parameters
48
48
A named pattern is surrounded with @ characters and links to a predefined pattern loaded from a file. The `default.tdg-patterns` file located in the same directory as the tdg executable file contains a list of named patterns which can be used in other patterns you write. For example to generate you could write something like `([1-9]\d\d-\d\d-\d\d\d\d)` or you can use the named parameter in the file `(@ssn@)` to a similar value. You can add more patterns to the file as you wish. Named patterns can also include other named patterns if you so wish. Take a look at the `@us_address_type1@` pattern in the file as an example of a compound pattern than uses other patterns to produce an output.
49
-
'3516 Delaware Terrace, Hunterdon County, Florida, yrwcB'
49
+
'8327 Maple Lane, Prince William County, Delaware, D@,^]'
50
50
51
51
### CommandLine tool
52
52
You can use the `tdg.exe` application to generate test data from the command line. It can handle provided templates directly from the command line or from a file. The tool also supports exporting the generated output to either the command line or another file.
@@ -63,23 +63,23 @@ You can use the `tdg.exe` application to generate test data from the command lin
63
63
### Examples
64
64
- Single repeating symbols using the following syntax
65
65
-`tdg -t 'Letters \<<\L{20}>> and Numbers \<<\d{12}>>'`
66
-
- Produces items like *'Letters MCKVNPVFNLYOYQLEISKI and Numbers 364796587178'*.
66
+
- Produces items like *'Letters HZEVGDYOVQHYWLEGNWIO and Numbers 588647416623'*.
67
67
- Repeating patterns containing multiple letters or numbers of random length.
68
-
-`tdg -t '\<<(\L){5}>>'` - Will generate 5 random upper-case characters. e.g. *'BAYFW'*
69
-
-`tdg -t '\<<(\L\L\d){24}>>'` - Will generate 24 repeating letter-letter-number values e.g. *'DY6CJ9OX0IU7ZY4WS9VQ6YX0AM3QB4XS1HF7UG0RX8WH7CS1HA3CD5FF0OC8PY8OK0NR7SB4'*
68
+
-`tdg -t '\<<(\L){5}>>'` - Will generate 5 random upper-case characters. e.g. *'HVFKK'*
69
+
-`tdg -t '\<<(\L\L\d){24}>>'` - Will generate 24 repeating letter-letter-number values e.g. *'DS6SS4LM8TK3XV0HF3KB5JO6UZ1LY6BG7WJ1QW8ML1QZ0VS8DB0MV3WU1AY7GZ5ES1OB4XQ3'*
70
70
- Variable length data can be generated also
71
-
-`tdg -t '\<<(\L){10,20}>>'` - Will generate a string containing between 10 and 20 characters of random value e.g. *'ETVBQJXUEIBDUPPCZSG'*
72
-
-`tdg -t 'Letters \<<\L{2,20}>> and Numbers \<<\d{2,12}>>'` produces items like *'Letters EBZZ and Numbers 86504'*
71
+
-`tdg -t '\<<(\L){10,20}>>'` - Will generate a string containing between 10 and 20 characters of random value e.g. *'YPKSPRYGJIWOOLL'*
72
+
-`tdg -t 'Letters \<<\L{2,20}>> and Numbers \<<\d{2,12}>>'` produces items like *'Letters PZQYBFMPMHWHRIFLUZWS and Numbers 0639596'*
73
73
- Input can contain several placeholders.
74
74
-`tdg -t 'Hi there \<<\L\v{0,2}\l{0,2}\v \L\v{0,2}\l{0,2}\v{0,2}\l{0,2}\l>> how are you doing? Your SSN is \<<[1-9]\d\d-\d\d-\d\d\d\d>>.' -c 100`
75
-
- Produces 100 items like *'Hi there Puevja Kpu how are you doing? Your SSN is 649-57-0837.'*
75
+
- Produces 100 items like *'Hi there Racbu Yeidvv how are you doing? Your SSN is 600-47-5575.'*
76
76
- Generate 100 SSN like values and output to console window.
77
77
-`tdg -t '\<<[1-9]\d\d-\d\d-\d\d\d\d>>' -c 100`
78
-
- Produces 100 items like *'i78-77-7377'*.
78
+
- Produces 100 items like *'R33-95-3798'*.
79
79
- Generate 100 strings with random name like values and output to file.
80
80
-`tdg -t 'Hi there \<<\L\v\l\v \L\v\l\l\v\v\l\l\v>> how are you doing?' -c 100 -o C:\test1.txt`
81
-
- Produces 100 items like *'Tahi Qosweazco'*.
82
-
-`tdg -t '\<<Letters \w{2,20} and Numbers \d{2,12}\n>>'` produces the following output: *'Letters jTmjHwIEh and Numbers 5805354
81
+
- Produces 100 items like *'Daeo Lelkiapqu'*.
82
+
-`tdg -t '\<<Letters \w{2,20} and Numbers \d{2,12}\n>>'` produces the following output: *'Letters BrVUEnR and Numbers 13535649
83
83
'*
84
84
85
85
## More Information
@@ -94,23 +94,23 @@ If you are familiar with Regular Expressions then most of the syntax used will b
94
94
`\<<\L\v\l\v>>` is a placeholder containing the pattern of symbols `\L\v\l\v`.
95
95
96
96
### Symbol Repetition
97
-
Individual symbols can be repeated by a supplying a repeat section immediately after the symbol. For example `\L{5}` will produce 5 upper case letters. You can also add some randomness to the mix by supplying a range: `\L{min,max}`. The pattern `\L{1,100}` will produce between 1 and 100 upper case letters. Here's one *'IRVSDAVDWXRUJQLKRWONRICEYUBTSFNTODTZNMTFIMOTXJDXKQWMAZEAORUJYBLRKXFGWMWFDJFFUIGOQEJBI'*
97
+
Individual symbols can be repeated by a supplying a repeat section immediately after the symbol. For example `\L{5}` will produce 5 upper case letters. You can also add some randomness to the mix by supplying a range: `\L{min,max}`. The pattern `\L{1,100}` will produce between 1 and 100 upper case letters. Here's one *'IXJERMZPVAKAJDXQBUQQLFQANYVCBRTYPUGTMCVW'*
98
98
99
99
### Symbol Grouping
100
-
Individual symbols can be grouped together using parenthesis characters. When grouped together they can be repeated using the same repeat syntax. `(\l\d){5}` will produce something like *'a7p9t4w6k2'*.
100
+
Individual symbols can be grouped together using parenthesis characters. When grouped together they can be repeated using the same repeat syntax. `(\l\d){5}` will produce something like *'y3u2l5v2q7'*.
101
101
You can also include the random range syntax from above.
102
102
103
103
### Alternating Symbols and Groups
104
104
Patterns can contain several individual symbols or groups of symbols and randomly alternate between them when generating the output value. `\<<\C|\c{10}|\V\V\V|(\v\v){2,3}>>` will produce either a single upper-case consonant, 10 lower-case consonants, 3 upper-case vowels or between 10 and 15 lower-case vowels. Which one gets outputed is randomly selected when processing the pattern.
105
105
106
106
### Other patterns:
107
-
-`'\<<This is a \L\L string>>'` will produce something similar to *'This is a GB string'*.
108
-
-`'\<<This is a \d{19} string>>'` will produce something similar to *'This is a 8301909763679223277 string'*.
107
+
-`'\<<This is a \L\L string>>'` will produce something similar to *'This is a NX string'*.
108
+
-`'\<<This is a \d{19} string>>'` will produce something similar to *'This is a 8291236768512445911 string'*.
109
109
- Individual symbols can be repeated a specific number of times using the syntax `\L{10}` which will generate 10 upper case letters.
110
110
- Individual symbols can be repeated a random number of times using the syntax `\L{10,20}` which will generate between 10 and 20 upper case letters.
111
111
- 1 or more Symbols can be combined into patterns by wrapping them in parenthesis e.g. `(\*\L\d)`.
112
-
- Patterns can be repeated a specific number of times using the syntax `(\L\d){10}` which will generate 10 repeated letter-number pairs e.g. *'S3J3E6H1B9N7C9D9Z2K7'*.
113
-
- Patterns can be repeated a random number of times using the syntax `(\L\d){10,20}` which will generate between 10 and 20 repeated letter-number pairs e.g. *'L2R6B8Z4F4L6M5R5Z8O6W8'*.
112
+
- Patterns can be repeated a specific number of times using the syntax `(\L\d){10}` which will generate 10 repeated letter-number pairs e.g. *'Y9T6C4K5Z1P4H1V1I8D4'*.
113
+
- Patterns can be repeated a random number of times using the syntax `(\L\d){10,20}` which will generate between 10 and 20 repeated letter-number pairs e.g. *'M0F0T6Z0D2I4O5Z0P8R8V6'*.
114
114
115
115
### Profiling results
116
116
*These timings are taken from unit tests making direct API calls, the command line tool will have higher times as it has additional IO work to output the values to screen or file. Should still be fast.*
0 commit comments