hl_keyword.c 1012 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * This program is free software; you can redistribute it and/or
  3. * modify it under the terms of the GNU General Public License
  4. * as published by the Free Software Foundation; either version 2
  5. * of the License, or (at your option) any later version.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. * Author: g0tsu
  12. * Email: g0tsu at dnmx.0rg
  13. */
  14. #include <libhighlight.h>
  15. #include <assert.h>
  16. static int hl_expr_test() {
  17. if (!hl_keyword_expr("break", 5))
  18. return 1;
  19. if (hl_keyword_expr("nIii", 4))
  20. return 1;
  21. if (!hl_keyword_type("short", 5))
  22. return 1;
  23. if (hl_keyword_type("nIii", 4))
  24. return 1;
  25. if (!hl_keyword_decl("auto", 4))
  26. return 1;
  27. if (hl_keyword_decl("nIii", 4))
  28. return 1;
  29. return 0;
  30. }
  31. int main() {
  32. assert(!hl_expr_test());
  33. return 0;
  34. }