-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
154 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#lang racket | ||
|
||
(module+ test | ||
(require | ||
;; main | ||
rackunit | ||
racket/match | ||
"main.rkt" | ||
(submod "main.rkt" main) | ||
) | ||
|
||
;; Any code in this `test` submodule runs when this file is run using DrRacket | ||
;; or with `raco test`. The code here does not run when this file is | ||
;; required by another module. | ||
|
||
;; (test-case "Test for add function" | ||
;; (check-equal? (+ 2 2) 4)) | ||
|
||
(test-case "Test diacritics" | ||
(define sdiacr "jkl \n abčd \n xyz \n 123 \n ábc \n 567") | ||
(define sd sdiacr) | ||
(define splain "jkl \n abcd \n xyz \n 123 \n abc \n 567") | ||
(define sp splain) | ||
(define rxs "abc") | ||
(define diarxs (create-regexp-split-match | ||
"i" | ||
(create-pattern-with-diacritics rxs))) | ||
|
||
(check-equal? (length (regexp-normalize-match* diarxs sdiacr)) | ||
(length (regexp-match* rxs splain))) | ||
(check-equal? (regexp-normalize-split diarxs sdiacr) | ||
(regexp-split rxs splain)) | ||
(check-equal? (regexp-normalize-split diarxs splain) | ||
(regexp-split rxs splain)))) |