# Transcrypt Autotester Demo

## Comparisons Versus Assertions

(Just in case you wonder where the test assertions are hidden)

Transcrypt's autotest framework verifies that the JS generated by Transcrypt on one hand, and CPython on the other, generate equal results at runtime.

So rather than matching JS output against hardcoded assertions, Transcrypt's autotest framework simply *generates* those assertions - by running the testlets within *CPython* (-r switch), recording the results, then within a Javascript runtime (e.g. your browser), comparing to the previous Python output.

## Usage

`autotest.py` and the testlets, by design, see above, can only run code which is within the supported transpilable set.

E.g. an `import sys` (without any exclusion pragmas) will break the test.

See the chapter *Autotesting Trancsrypt code* in the docs for a motivation and some more explanation.


Thats why you have to add the current working directory to have `autotest.py`
find the testlets *outside* the Python runtime, not within, via `sys.path.insert`.

On POSIX systems this is the standard way: `export PYTHONPATH=".:$PYTHONPATH"`
