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

builtin,strconv: append ".0", to float string representations, to ensure clarity (#16079)

This commit is contained in:
Subhomoy Haldar
2022-10-17 13:41:07 +01:00
committed by GitHub
parent 29b1796791
commit 43b9a716c5
21 changed files with 98 additions and 74 deletions

View File

@@ -2,7 +2,7 @@ fn test_map_of_f32() {
mut m32 := map[f32]string{}
m32[1.0] = 'one'
println(m32)
assert '$m32' == r"{1.: 'one'}"
assert '$m32' == r"{1.0: 'one'}"
for k, v in m32 {
assert typeof(k).name == 'f32'
assert typeof(v).name == 'string'
@@ -17,7 +17,7 @@ fn test_map_of_f64() {
}
m64[1.0] = 'one'
println(m64)
assert '$m64' == r"{3.14: 'pi', 1.: 'one'}"
assert '$m64' == r"{3.14: 'pi', 1.0: 'one'}"
for k, v in m64 {
assert typeof(k).name == 'f64'
assert typeof(v).name == 'string'