Skip to content

Instantly share code, notes, and snippets.

@alcidesfp
Created March 13, 2012 05:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alcidesfp/2027117 to your computer and use it in GitHub Desktop.
Save alcidesfp/2027117 to your computer and use it in GitHub Desktop.
Kata NumberToLCD en Racket - Pruebas Unitarias
;; -*- coding:utf-8; mode:Scheme -*-
#lang racket
(require rackunit
rackunit/text-ui
"numero-lcd.rkt")
(define-test-suite numero-lcd-suite
(test-case
"prueba visualiza lcd"
;;(fail "prueba no implementada")
(let ((pruebas '((1 (string-append " \n"
" |\n"
" \n"
" |\n"
" \n"))
(2 (string-append " - \n"
" |\n"
" - \n"
"| \n"
" - \n"))
(3 (string-append " - \n"
" |\n"
" - \n"
" |\n"
" - \n"))
(4 (string-append " \n"
"| |\n"
" - \n"
" |\n"
" \n"))
(5 (string-append " - \n"
"| \n"
" - \n"
" |\n"
" - \n"))
(6 (string-append " - \n"
"| \n"
" - \n"
"| |\n"
" - \n"))
(7 (string-append " - \n"
" |\n"
" \n"
" |\n"
" \n"))
(8 (string-append " - \n"
"| |\n"
" - \n"
"| |\n"
" - \n"))
(9 (string-append " - \n"
"| |\n"
" - \n"
" |\n"
" - \n"))
(0 (string-append " - \n"
"| |\n"
" \n"
"| |\n"
" - \n"))) ))
(for ((elem pruebas))
(check-equal? (num->lcd (car elem))
(eval (cadr elem)) )) ))
)
;--------------------------------------------------------------
(run-tests numero-lcd-suite)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment