test(tests/lean): add test for new string support

This commit is contained in:
Leonardo de Moura 2016-05-24 16:27:12 -07:00
parent 6a9e5079c9
commit 570ae36148
2 changed files with 48 additions and 0 deletions

34
tests/lean/str1.lean Normal file
View file

@ -0,0 +1,34 @@
import data.list
-- set_option pp.all true
open string char list
check "ABC"
check str (of_nat 68) (str (of_nat 65) (str (of_nat 66) "abc"))
check list.cons (of_nat 65) "abc"
check list.cons (of_nat 66) (list.cons (of_nat 65) list.nil)
check (of_nat 67)::(of_nat 66)::(of_nat 65)::nil
check (of_nat 68)::"abc"
check append "abc" "cde"
set_option pp.strings false
check "ABC"
check str (of_nat 68) (str (of_nat 65) (str (of_nat 66) "abc"))
check list.cons (of_nat 65) "abc"
check list.cons (of_nat 66) (list.cons (of_nat 65) list.nil)
check (of_nat 67)::(of_nat 66)::(of_nat 65)::nil
check (of_nat 68)::"abc"
check append "abc" "cde"

View file

@ -0,0 +1,14 @@
"ABC" : string
"abcBAD" : string
"abcA" : list char
"AB" : list char
"ABC" : list char
"abcD" : list char
"abc" ++ "cde" : list char
str 67 (str 66 (str 65 empty)) : string
str 68 (str 65 (str 66 (str 99 (str 98 (str 97 empty))))) : string
65 :: str 99 (str 98 (str 97 empty)) : list char
[66, 65] : list char
[67, 66, 65] : list char
68 :: str 99 (str 98 (str 97 empty)) : list char
str 99 (str 98 (str 97 empty)) ++ str 101 (str 100 (str 99 empty)) : list char