-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* normalize output and test output and then compare * separate ordered data lines from unordered data lines + only remove space after colon if its after a key at the beginning of the line * don't remove space after colon * only sort unordered fields * update readme * add gitignore to sdk/.test folder
- Loading branch information
Showing
6 changed files
with
47 additions
and
6 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
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,2 @@ | ||
**/**/norm*.txt | ||
**/**/testOutput.txt |
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
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,32 @@ | ||
#!/bin/sh | ||
|
||
awk ' | ||
BEGIN { RS = "\n\n\n"; FS = "\n"; } | ||
function flush_data(data) { | ||
if (data) { | ||
print data | "sort" | ||
close("sort", "to") | ||
} | ||
return "" | ||
} | ||
{ | ||
data = "" | ||
for (i = 1; i <= NF; i++) { | ||
if ($i ~ /^data: (fragments|script|path)/) { | ||
data = flush_data(data) | ||
print $i | ||
} else if ($i ~ /^data:/) { | ||
data = data $i "\n" | ||
} else { | ||
data = flush_data(data) | ||
print $i | ||
} | ||
} | ||
# flush remaining unordered data lines | ||
flush_data(data) | ||
} | ||
' "$1" |
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
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