Imagine a form that asks for an estimated number of people in a room. A respondent can enter a number or type “I don’t know.” Someone else types “I don't know,” with a straight apostrophe. The phrases carry the same meaning in this field. They contain different characters, so a validator that compares the spelling exactly can give the two respondents different results. We examined a form that treats those two characters as equivalent in one typed answer while keeping its choice label stable. We also inspected how a separate workbook prepares the received text for comparison.

A typed response and a choice have different jobs

A choice field gives the respondent an answer to select. The form builder supplies that label, so every generated instance can use the same spelling. A typed field leaves those characters to the person entering the answer. Even when a form shows the intended phrase as an example, the entered text can contain a different apostrophe. The change we looked at retained the straight apostrophe in the fixed choice label and allowed both the straight apostrophe and the right curly apostrophe in the typed phrase.

That distinction gives us two things to verify. For a choice field, the mock can compare the generated string with the expected label character for character. For a typed field, it can exercise the generated validation pattern with values that ought to pass or fail. A test that compares only the label would tell us nothing about the second question. A test that checks only whether the two typed phrases pass would leave the exact choice label unexamined. Each assertion follows the way that particular answer reaches the form.

Test the characters next to the ones you accept

The local checks tried both spellings against three generated patterns for fields that also accept numbers. In the examples that allowed the unknown answer, each pattern matched both spellings. The fixtures also included ordinary numeric values and values at or outside field-specific bounds. Together those inputs check that adding a spelling to the accepted text did not make the tested pattern accept every number. The fields have different numeric ranges, so what passes in one fixture does not by itself say what another field should accept.

The suite also supplied near-misses. Tested examples include removing the apostrophe, using a left curly quote, and adding a trailing space. Those particular inputs were rejected where the suite exercised them. That gives the change a more useful description than simply saying it accepts curly punctuation. It accepts a specific additional character at a specific location in a phrase. The passing examples define what the equivalence covers, and the rejected examples show where the tested validators still draw a boundary. The left curly quote is useful as a control because it looks similar to the accepted character without being the same character.

Separate accepting text from comparing it later

A separate workbook handles the text at another point. Inspection of its committed file found formulas that trim the input and replace the right curly apostrophe with the straight one. The form pattern answers whether the spelling is allowed at entry. The workbook formula describes a transformation intended to give those two spellings the same representation for a later comparison. These are different operations. A pattern can accept two forms while leaving their characters intact. A substitution changes what a later comparison can see.

The local form suite reported 3,613 passing assertions at the merged revision. That count covers the whole mocked form suite, including the punctuation checks. It used JavaScript to evaluate the generated patterns, so it leaves actual hosted form behavior and device input unverified. The workbook inspection established that the formula was present. We did not recalculate the workbook or check that the two answers produced the same result there. To verify agreement between the two surfaces, a test would need to submit both variants to the actual validator and then compare the workbook results after recalculation. The evidence we have lets us answer a narrower question about the form change. Given these exact test inputs, the generated patterns accepted the chosen spelling variants and retained the boundaries exercised by the other fixtures.

← All engineering articles