File: edit_distance.reference

package info (click to toggle)
ocaml 5.4.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 44,384 kB
  • sloc: ml: 370,196; ansic: 52,820; sh: 27,419; asm: 5,462; makefile: 3,684; python: 974; awk: 278; javascript: 273; perl: 59; fortran: 21; cs: 9
file content (38 lines) | stat: -rw-r--r-- 1,025 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
[01] (edit_distance "a" "a" 1), expected Some 0
OK
[02] (edit_distance "a" "a" 0), expected Some 0
OK
[03] (edit_distance "a" "b" 1), expected Some 1
OK
[04] (edit_distance "a" "b" 0), expected None
OK
[05] (edit_distance "add" "adad" 3), expected Some 1
OK
[06] (edit_distance "delete" "delte" 3), expected Some 1
OK
[07] (edit_distance "subst" "sabst" 3), expected Some 1
OK
[08] (edit_distance "swap" "sawp" 3), expected Some 1
OK
[09] (edit_distance "abbb" "bbba" 3), expected Some 2
OK
[10] (edit_distance "abbb" "bbba" 1), expected None
OK
[11] (edit_distance "xyzwabc" "mnpqrabc" 10), expected Some 5
OK
[12] (edit_distance "abcxyzw" "abcmnpqr" 10), expected Some 5
OK
[13] (edit_distance "a" "a" max_int), expected Some 0
OK
[14] (edit_distance "a" "b" max_int), expected Some 1
OK
[15] (edit_distance "abc" "ade" max_int), expected Some 2
OK
[16] (edit_distance "" "" 3), expected Some 0
OK
[17] (edit_distance "" "abc" 3), expected Some 3
OK
[18] (edit_distance "abcd" "" 3), expected None
OK

All tests succeeded.