These days I am trying to find out a way how to vi...
# thinking-together
p
These days I am trying to find out a way how to visualise my tests. By visualisation I mean creating visual “DSLs” in which I can draw up both the input and the output as a 2D “ASCII art”. 🙂 I use typescript/javascript. Do you have any idea how to efficiently do that? Is there an established way (eg. lib) to do something like that? Example: input:
Copy code
.=========.
|         |
| O**O  + |
| *       |
| *       |
| O**O  + |
|     *   |
|      *  |
| O**O**O |
|         |
.=========.
.deleteNode(0,0)
expected result: (change on top left)
Copy code
.=========.
|         |
| +  O  + |
|         |
|         |
| O**O  + |
|     *   |
|      *  |
| O**O**O |
|         |
.=========.
👍 1
❤️ 2
d
b
I've got a DSL I call Swarm for my unit testing (following the arrange/act/assert pattern)....Two sample programs written in it are attached. I bet by changing a few lines of code I could generalize this so it might be easy to pull off your use case. If that sounds interesting, we could discuss more here or just go and create an issue here https://github.com/treenotation/jtree/issues and I can get to it soon.
c
@Pezo - Zoltan Peto have you seen http://www.dirk-loss.de/sshvis/drunken_bishop.pdf
p
Thanks for the responses, what I have found is Dependent Types are needed for my use case