Skip to main content

testnot

Description

testnot is a table operator that allows you to write unit tests for symbols in your Gramble code, checking whether the grammar outputs are not compatible with the forms listed in the test. It can be a sibling to a symbol or to another table operator and applies to the symbol above it.

Usage examples

In this example, the grammar produced by the symbol Verb consists of six entries (each of the two Root forms concatenated with each of the three Suffix forms). If we want to confirm that the output of Verb does not contain an entry with the text "caller" and that it does not contain an entry with the text form "jump", we can write a testnot for it:

Root =textroot
callcall
jumpjump
 
Suffix = texttense
s3SG.PRES
edPAST
ingPRES.PROG
 
Verb =embedembed
RootSuffix
 
testnot:text
caller
jump

We can include any fields from the symbol in our test, for example:

testnot:texttense
caller3SG.PRES
jumpPRES.PROG
jumpingPAST

The testnot can be run by going to the Gramble dropdown menu and selecting either "Run all unit tests on sheet" or by first selecting the cell of the sheet containing the symbol and then going to the dropdown and selecting an option to just run tests for that symbol or reachable from that symbol.

When the testnot runs in a Google Sheet, any rows that pass it (i.e., the entry in that row cannot be generated from the given symbol) will be highlighted in green. All of the testnot examples shown here should pass and be highlighted in green. Any that fail, where the entry could be generated, will be highlighted in red with a note saying "TEST FAILED: The grammar above incorrectly has outputs compatible with this specification."

For examples of how to run a test to confirm that a form is in the entries generated by a grammar, see the test page.