Compare commits

..

1 Commits

Author SHA1 Message Date
7d098e6b92
add woodpecker ci
Some checks failed
ci/woodpecker/push/test Pipeline failed
2025-02-27 23:06:40 -08:00
6 changed files with 56 additions and 43 deletions

15
.woodpecker/test.yaml Normal file
View 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

View File

@ -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

View File

@ -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

View File

@ -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))

View File

@ -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
View 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)
}