Skip to content

Commit 5c4c435

Browse files
committed
byte: more tests
1 parent 3722e16 commit 5c4c435

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
*Not yet released*
33
- `vweb` now uses struct embedding: `app.vweb.text('hello') => app.text('hello')`.
44
- Consts can now be declared outside of `const()` blocks: `const x = 0`.
5-
- Allow overloading of `>`, `<`, `!=` and `==` operators.
6-
- Add struct updating syntax: `Mystruct{ ...ms, name: 'new' }`.
5+
- Overloading of `>`, `<`, `!=`, and `==` operators.
6+
- New struct updating syntax: `User{ ...u, name: 'new' }` to replace `{ u | name: 'new' }`.
7+
- `byte.str()` has been fixed and works like with all other numbers. `byte.ascii_str()` has been added.
78

89
## V 0.2.1
10+
*30 Dec 2020*
911
- Hashmap bootstrapping fixes.
1012
- Array decomposition to varargs: `fn sum(i ...int) int` => `a := [2,3,4] println(sum(a...))`
1113
- HTML module docs generated by vdoc now have global search.

vlib/builtin/byte_test.v

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@ fn test_clone() {
55
assert b[0] == 0
66
assert b[1] == 1
77
assert b[2] == 2
8-
println(b[1].ascii_str())
8+
assert b[1].str() == '1'
9+
xx := byte(35)
10+
assert xx.str() == '35'
11+
assert xx.ascii_str() == '#'
912
println(typeof(`A`))
13+
assert typeof(`A`) == 'rune'
1014
x := rune(`A`)
1115
assert x.str() == 'A'
1216
assert typeof(x) == 'rune'

0 commit comments

Comments
 (0)