C — JSON
Due Thursday, 15 September 2022, 11:59pm
Purpose to explore the JSON libraries of the chosen programming language; to deliver software as specified
Delivery You must deliver xjson and Tests/ in a directory called C in your code repository. The two artifacts are specified in the Task and Tests sections below.
All auxiliary files must be put into a sub-directory called C/Other/.
{ "vertical" : Vertical, "horizontal" : Horizontal } |
|
For each object, xjson computes the corresponding Acceptable string. The "vertical" field determines whether the string contains a line that points up or down from the center; the "horizontal" field dictates whether a string’s horizontal line goes left or right from the center. The program collects these one-character strings, in order. It prints a JSON array of this collection to STDOUT when the input stream is exhausted.
Tests Place three tests for xjson in the directory Tests/.
You should never refer to anything as a test that doesn’t specify both inputs and expected results.
A test case always consists of given inputs and expected outputs. For this
course, a test consists of a pair of files: n-in.json, the input file, and
n-out.json, the expected output file, where n is an integer between 0
and the requested number of tests (exclusive).—
Constraint No test file may exceed the size limit of 20Kb.
Note Our test harness compares expected JSON and actual JSON via a JSON-equality predicate, so white space or ordering of fields in objects in the expected output file does not matter.