You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
990 B

  1. #include "unity.h"
  2. #include <input.h>
  3. #include <stdlib.h>
  4. void setUp(void){
  5. }
  6. void tearDown(void){
  7. }
  8. void test_testArrow(void){
  9. char result = getTInput('\033');
  10. TEST_ASSERT_EQUAL_CHAR('ar', result);
  11. }
  12. void test_testw(void){
  13. char result = getTInput('w');
  14. TEST_ASSERT_EQUAL_CHAR('w', result);
  15. }
  16. void test_testa(void){
  17. char result = getTInput('a');
  18. TEST_ASSERT_EQUAL_CHAR('a', result);
  19. }
  20. void test_tests(void){
  21. char result = getTInput('s');
  22. TEST_ASSERT_EQUAL_CHAR('s', result);
  23. }
  24. void test_testd(void){
  25. char result = getTInput('d');
  26. TEST_ASSERT_EQUAL_CHAR('d', result);
  27. }
  28. void test_testq(void){
  29. char result = getTInput('q');
  30. TEST_ASSERT_EQUAL_CHAR('q', result);
  31. }
  32. void test_testp(void){
  33. char result = getTInput('p');
  34. TEST_ASSERT_EQUAL_CHAR('p', result);
  35. }
  36. void test_testn(void){
  37. char result = getTInput('n');
  38. TEST_ASSERT_EQUAL_CHAR('n', result);
  39. }
  40. void test_testg(void){
  41. char result = getTInput('g');
  42. TEST_ASSERT_EQUAL_CHAR('n', result);
  43. }