-
Notifications
You must be signed in to change notification settings - Fork 404
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
830b749
commit c5ee3e9
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
|
||
# Parse Tests | ||
|
||
The `parse_tests` directory contains test cases for `js_test.go`. `js_test.go` | ||
scans for files named `DDD-*.js` where `DDD` is a three-digit number. | ||
|
||
* `parse_tests/001-basic.js` -- The dnsconfig.js file. | ||
* `parse_tests/001-basic.json` -- The EXPECTED output of "print-ir" for the `.js` file. | ||
* `parse_tests/001-basic.json.ACTUAL` -- The ACTUAL output of "print-ir" for the `.js` file (not saved in git) | ||
* `parse_tests/001-basic/foo.com.zone` -- Zonefiles from the domains mentioned in dnsconfig.js | ||
|
||
NOTE: The zonefiles are only generated if a matching `DDD-name/DOMAINNAME.zone` file exists. | ||
|
||
Any files committed to Git should be in standard format. | ||
|
||
# Fix formatting | ||
|
||
Fix the `.js` formatting: | ||
|
||
``` | ||
cd parse_tests | ||
for i in *.js ; do echo ========== $i ; dnscontrol fmt -i $i -o $i ; done | ||
``` | ||
|
||
Fix the `.json` formatting: | ||
|
||
``` | ||
cd parse_tests | ||
fmtjson *.json *.json.ACTUAL | ||
``` | ||
|
||
# Copy actuals to expected. | ||
|
||
Back-port the ACTUAL results to the expected results: | ||
|
||
(This is dangerous. Carefully inspect the resulting PR.) | ||
|
||
``` | ||
cd parse_tests | ||
fmtjson *.json *.json.ACTUAL | ||
for i in *.ACTUAL ; do f=$(basename $i .ACTUAL) ; cp $i $f ; done | ||
``` |