-
Notifications
You must be signed in to change notification settings - Fork 0
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
しずえ
committed
Oct 25, 2021
1 parent
fd4e8be
commit 0ee8404
Showing
2 changed files
with
24 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,24 @@ | ||
## Example 1. Bad sort | ||
|
||
This example demonstrates the highlighting capabilities of scold. | ||
|
||
`inputs.txt` specifies the test cases for a program that sorts integers in ascending order. The test program, however, sorts integers as if they were strings -- in a lexicographical order. | ||
|
||
Run the example using: | ||
``` | ||
$ go build bad_sort.go | ||
$ scold bad_sort | ||
``` | ||
|
||
Or, since ver2.01a, you can just do | ||
``` | ||
$ scold go run bad_sort.go | ||
``` | ||
|
||
The output will look like this: | ||
|
||
![scold's output for example 1](output.png) | ||
|
||
1. Note that in the first test case there is a mismatch between 10 and 11, and, even though, the first characters (`'1'`) match, the numbers are highlighted fully. | ||
2. In the second test case, there is a mismatch between 20 and -20, but only the *sign* is highlighted. | ||
3. scold intentionally ignores presentation differences. The +0 and 00 seem different as strings, but truly *are* zeros, so no mismatch is found. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.