Fork of Repository Name.
This repository is used to hold any branches of Repository Name I am developing on or have submitted pull requests for.
It seemed unnessessy to maintain an up to date master branch so I have replaced it with this placeholder.
% Plot normal distribution: | |
figure(1) | |
x=randn(1000,1); | |
subplot(211), | |
hist(x,20) | |
subplot(212), | |
ksdensity(x,’width’,0.1) | |
% Plot uniform distribution: | |
figure(2) | |
x=rand(1000,1); |
Everybody's second favourite programming language to be developed in the last decade has the following to say about unit tests:
The purpose of unit tests is to test each unit of code in isolation from the rest of the code to quickly pinpoint where code is and isn’t working as expected. You’ll put unit tests in the src directory in each file with the code that they’re testing.
To allow elm developers to put their unit tests in the same file as the source code, this document proposes a special type of comment with the syntax {-test- ... -}
in elm source files.
These comments are test blocks, wrapping code that should only be run when testing.
The elm compiler ignores code in test blocks (as it ignores everything in comments) but an elm test runner could extract tests and supporting code from such test blocks and run them.
folkertdev [Yesterday at 9:53 PM] | |
you mean something custom? | |
10 replies | |
ilias [17 hours ago] | |
The builtin one is a todo :sweat_smile: |
Not because this guide is any good, but because it is the only one.
This is (to the best of my knowledge) correct as of version 19.0 of the elm compiler and version 1.0.2 of elm/core
.
Cmd
s- Port
Cmd
s (I believe these to be fundamentally different from normalCmd
s). Sub
s.
I like lexer/parser approach because there seem to be two hard parts to going from text to an AST:
- Dealing with text
- Working out the (possibly recursive structure of the text)
Elm is a really nice language in that you can separate the two hard parts cleanly when writing a parser for it: