1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

builtin: new str(), hex() functions without C.printf

This commit is contained in:
penguindark
2020-03-11 00:38:11 +01:00
committed by GitHub
parent de55a26cfe
commit 630913d872
4 changed files with 216 additions and 99 deletions

View File

@ -616,3 +616,13 @@ fn test_trim() {
assert arr.len == 2
assert arr.last() == 2
}
fn test_hex(){
// array hex
st := [byte(`V`),`L`,`A`,`N`,`G`]
assert st.hex() == "564c414e47"
assert st.hex().len == 10
st1 := [byte(0x41)].repeat(100)
assert st1.hex() == "41".repeat(100)
}