fortheck/test/token_test.gleam

23 lines
377 B
Gleam

import fortheck/token
import gleam/iterator
import gleeunit
import gleeunit/should
pub fn main() {
gleeunit.main()
}
pub fn tokenize_test() {
let string = "3 4\nMUL\t5 \n\n \n dIv"
string
|> token.tokenize
|> iterator.to_list
|> should.equal([
token.Number(3),
token.Number(4),
token.Word("MUL"),
token.Number(5),
token.Word("DIV"),
])
}