test: String.get' and String.next'

This commit is contained in:
Leonardo de Moura 2022-11-09 17:02:49 -08:00
parent afa567fc09
commit 7b8ade5ee4
2 changed files with 7 additions and 0 deletions

View file

@ -58,3 +58,7 @@ def ssDots : Substring := "____abc.αβγ.123.____".toSubstring.extract ⟨4⟩
#eval ssDots.splitOn "."
def ssHyphs : Substring := "____abc--αβγ--123--____".toSubstring.extract ⟨4⟩ ⟨22⟩
#eval ssHyphs.splitOn "--"
#eval "αβγ".get' 0 (by decide)
#eval "αβγ".get' ⟨2⟩ (by decide)
#eval "αβγ".next' ⟨2⟩ (by decide)

View file

@ -42,3 +42,6 @@ false
"abcd".toSubstring
["abc".toSubstring, "αβγ".toSubstring, "123".toSubstring, "".toSubstring]
["abc".toSubstring, "αβγ".toSubstring, "123".toSubstring, "".toSubstring]
'α'
'β'
{ byteIdx := 4 }