Gottox / terminal.js

Javascript terminal emulator library that aims to be xterm compliant and is supposed to work in browsers and node.js.
http://terminal.js.org
MIT License
592 stars 69 forks source link

Property testing against other vt100 implementations #122

Open Widdershin opened 7 years ago

Widdershin commented 7 years ago

Hey, here's an idea:

There is a form of testing called property testing or generative testing, originally popularized by the quickcheck library in Haskell. The idea is to identify properties of a piece of code, and create generators that provide arbitrary inputs, so that test cases can be generated.

If there are other vt100 implementations that are considered to be gold standard, we could write a property test for terminal.js to encode the property that given the same inputs, the terminal text representation should be equivalent to the program used as a reference implementation.

I'm interested in exploring this option, but I'm unsure which vt100 implementations are considered gold standard. They don't even need to be written in JavaScript, we could use a subprocess in node to communicate with them.

@Gottox what problems do you test terminal.js against to compare behaviour?

Gottox commented 7 years ago

The golden Standard is imho xterm. It supports most escape sequences, including stuff that I never saw in real world usage (double width/height for example). But I guess it's hard to get information out of the terminal.

Another option would be vte, I'm not sure what's exposed to the api, but it should be possible to test against this implementation.

If you like to add such test scenarios to terminal.js feel free, it could be a helpful tool.