test: Initial test work
This commit is contained in:
		@@ -1,13 +1,21 @@
 | 
			
		||||
import gleeunit
 | 
			
		||||
import dllist
 | 
			
		||||
import startest
 | 
			
		||||
 | 
			
		||||
pub fn main() -> Nil {
 | 
			
		||||
  gleeunit.main()
 | 
			
		||||
  startest.run(startest.default_config())
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// gleeunit test functions end in `_test`
 | 
			
		||||
pub fn hello_world_test() {
 | 
			
		||||
  let name = "Joe"
 | 
			
		||||
  let greeting = "Hello, " <> name <> "!"
 | 
			
		||||
pub fn is_empty_tests() {
 | 
			
		||||
  startest.describe("is_emtpy", [
 | 
			
		||||
    startest.it("terminated list", fn() {
 | 
			
		||||
      assert dllist.is_empty(dllist.new())
 | 
			
		||||
 | 
			
		||||
  assert greeting == "Hello, Joe!"
 | 
			
		||||
      assert !dllist.is_empty(dllist.new() |> dllist.insert(1))
 | 
			
		||||
    }),
 | 
			
		||||
    startest.it("cyclic list", fn() {
 | 
			
		||||
      assert dllist.is_empty(dllist.new_cyclic())
 | 
			
		||||
 | 
			
		||||
      assert !dllist.is_empty(dllist.new_cyclic() |> dllist.insert(1))
 | 
			
		||||
    }),
 | 
			
		||||
  ])
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user