fortheck/test/token_test.gleam

24 lines
377 B
Gleam
Raw Normal View History

2024-09-19 11:36:39 +02:00
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"),
])
}