arademaker / krr

Knowledge Representation and Reasoning
3 stars 6 forks source link

testing framework #37

Open arademaker opened 9 years ago

arademaker commented 9 years ago

Precisamos decidir por algum framework de testes. Para uma introdução:

http://www.gigamonkeys.com/book/practical-building-a-unit-test-framework.html

Opções:

Vejam resposta que tive na thread redline6561/coleslaw#82 onde foi sugerido a segunda opção acima.

Ver também:

http://eudoxia.me/article/lisp-travis-coveralls/

paulodt commented 9 years ago

Professor, fiz dois testes com a minha função, "length-form",e um teste com a função "in-tableaux", usando o "fiveam". Se o resultado não for o desejado pelo senhor, faço de outra forma. Os comandos e resultados foram:

--"lentgh-form" "Break 15 5AM[18]> (ql:quickload :fiveam)To load "fiveam": Load 1 ASDF system: fiveam ; Loading "fiveam"

(:FIVEAM)

Break 15 5AM[18]> (in-package :it.bese.fiveam )

Break 15 5AM[18]> (test length-form (is (= 3 (length-form '(implies (and A B) (and C D))))) (is (= 7 (length-form '(and (and (implies A B) (implies B A)) (and (implies B C) (implies C B))))))) LENGTH-FORM

Break 15 5AM[18]> (run! 'length-form)

Running test LENGTH-FORM .. Did 2 checks. Pass: 2 (100%) Skip: 0 ( 0%) Fail: 0 ( 0%)

NIL"

--"in_tableaux" Break 27 5AM[30]> (test in_tableaux (is (equal '((1 9 2) (2 6 1) (3 4 3) (4 9 2) (6 8 1) (8 7 2)) (in_tableaux '(0 0 0 0 0 0 0 0 2 0 0 0 0 0 1 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0))))) IN_TABLEAUX

Break 27 5AM[30]> (run! 'in_tableaux) Running test IN_TABLEAUX . Did 1 check. Pass: 1 (100%) Skip: 0 ( 0%) Fail: 0 ( 0%)

NIL"

arademaker commented 9 years ago

Paulo,

O issue não é sobre rodar testes, mas sobre como criar conjuntos de testes usando algum framework para testes. Não adianta rodar apenas alguns testes no REPL. Precisamos criar um conjunto de testes para testar tudo que fizemos até agora.

Seguindo o tutorial https://goo.gl/7sGSZV depois do commit 766364b tive como resposta no SBCL:

TABLEAUX-TEST> (run! 'length-1)
 Didn't run anything...huh?
NIL

Não consegui entender. Talvez algum outro framework seja mais fácil. De qq modo, já reportei problema em sionescu/fiveam#21

Não entendi seu teste in_tableaux!