Compare commits
1 Commits
master
...
feature/ci
Author | SHA1 | Date | |
---|---|---|---|
7d098e6b92 |
15
.woodpecker/test.yaml
Normal file
15
.woodpecker/test.yaml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
when:
|
||||||
|
- event: push
|
||||||
|
branch:
|
||||||
|
- master
|
||||||
|
- main
|
||||||
|
- feature/ci
|
||||||
|
- event: pull_request
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: test
|
||||||
|
image: ghcr.io/gleam-lang/gleam:v1.8.1-erlang-alpine
|
||||||
|
commands:
|
||||||
|
- gleam deps download
|
||||||
|
- gleam test
|
||||||
|
- gleam format --check src test
|
@ -1,8 +1,6 @@
|
|||||||
# GFLAP
|
# glemt
|
||||||
|
|
||||||
Computational theory automata built with Gleam, work in progress.
|
Computational theory automata, work in progress.
|
||||||
|
|
||||||
Inspired by [JFLAP](https://www.jflap.org/)
|
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
name = "gflap"
|
name = "glemt"
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
|
|
||||||
# Fill out these fields if you intend to generate HTML documentation or publish
|
# Fill out these fields if you intend to generate HTML documentation or publish
|
||||||
|
@ -140,7 +140,7 @@ pub fn ends_with_b() -> NFA {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
io.println("Hello from gflap!")
|
io.println("Hello from glemt!")
|
||||||
|
|
||||||
let automaton = even_a()
|
let automaton = even_a()
|
||||||
let _ = io.debug(is_dfa(automaton))
|
let _ = io.debug(is_dfa(automaton))
|
@ -1,37 +0,0 @@
|
|||||||
import gflap
|
|
||||||
import gleeunit
|
|
||||||
import gleeunit/should
|
|
||||||
|
|
||||||
pub fn main() {
|
|
||||||
gleeunit.main()
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn nfa_even_a_test() {
|
|
||||||
gflap.even_a()
|
|
||||||
|> gflap.check_string("")
|
|
||||||
|> should.equal(True)
|
|
||||||
|
|
||||||
gflap.even_a()
|
|
||||||
|> gflap.check_string("a")
|
|
||||||
|> should.equal(False)
|
|
||||||
|
|
||||||
gflap.even_a()
|
|
||||||
|> gflap.check_string("aa")
|
|
||||||
|> should.equal(True)
|
|
||||||
|
|
||||||
gflap.even_a()
|
|
||||||
|> gflap.check_string("aaa")
|
|
||||||
|> should.equal(False)
|
|
||||||
|
|
||||||
gflap.even_a()
|
|
||||||
|> gflap.check_string("aaaa")
|
|
||||||
|> should.equal(True)
|
|
||||||
|
|
||||||
gflap.even_a()
|
|
||||||
|> gflap.check_string("aab")
|
|
||||||
|> should.equal(False)
|
|
||||||
|
|
||||||
gflap.even_a()
|
|
||||||
|> gflap.check_string("baabaa")
|
|
||||||
|> should.equal(False)
|
|
||||||
}
|
|
37
test/glemt_test.gleam
Normal file
37
test/glemt_test.gleam
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
import glemt
|
||||||
|
import gleeunit
|
||||||
|
import gleeunit/should
|
||||||
|
|
||||||
|
pub fn main() {
|
||||||
|
gleeunit.main()
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn nfa_even_a_test() {
|
||||||
|
glemt.even_a()
|
||||||
|
|> glemt.check_string("")
|
||||||
|
|> should.equal(True)
|
||||||
|
|
||||||
|
glemt.even_a()
|
||||||
|
|> glemt.check_string("a")
|
||||||
|
|> should.equal(False)
|
||||||
|
|
||||||
|
glemt.even_a()
|
||||||
|
|> glemt.check_string("aa")
|
||||||
|
|> should.equal(True)
|
||||||
|
|
||||||
|
glemt.even_a()
|
||||||
|
|> glemt.check_string("aaa")
|
||||||
|
|> should.equal(False)
|
||||||
|
|
||||||
|
glemt.even_a()
|
||||||
|
|> glemt.check_string("aaaa")
|
||||||
|
|> should.equal(True)
|
||||||
|
|
||||||
|
glemt.even_a()
|
||||||
|
|> glemt.check_string("aab")
|
||||||
|
|> should.equal(False)
|
||||||
|
|
||||||
|
glemt.even_a()
|
||||||
|
|> glemt.check_string("baabaa")
|
||||||
|
|> should.equal(False)
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user