mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
string: update the test
This commit is contained in:
parent
216fea1eb3
commit
43d56cb883
@ -1,5 +1,8 @@
|
||||
## V 0.2.2
|
||||
## V 0.2.3
|
||||
*Not yet released*
|
||||
|
||||
## V 0.2.2
|
||||
*22 Jan 2021*
|
||||
- `vweb` now uses struct embedding: `app.vweb.text('hello') => app.text('hello')`.
|
||||
- Consts can now be declared outside of `const()` blocks: `const x = 0`.
|
||||
- Overloading of `>`, `<`, `!=`, `==`, `<=` and `>=` operators.
|
||||
@ -16,6 +19,8 @@
|
||||
- Fix `go` with a generic function: `go test<string>(c, 'abcd')`.
|
||||
- Add comptime `x := $embed_file('v.png') println(x.len) println(ptr_str(x.data()))`, for embedding files into binaries.
|
||||
- Advanced vdoc search on mobile layout.
|
||||
- string's `left()`/`right` were removed in favor of slicing syntax: `str[..pos]`.
|
||||
- gg: native graphics mode on macOS/iOS (using Cocoa Drawing API).
|
||||
|
||||
## V 0.2.1
|
||||
*30 Dec 2020*
|
||||
|
@ -365,16 +365,14 @@ fn test_runes() {
|
||||
|
||||
fn test_left_right() {
|
||||
s := 'ALOHA'
|
||||
assert s.left(3) == 'ALO'
|
||||
assert s.left(0) == ''
|
||||
assert s.left(8) == s
|
||||
assert s.right(3) == 'HA'
|
||||
assert s.right(6) == ''
|
||||
assert s[..3] == 'ALO'
|
||||
assert s[..0] == ''
|
||||
assert s[..5] == s
|
||||
assert s[3..] == 'HA'
|
||||
//assert s.right(6) == ''
|
||||
u := s.ustring()
|
||||
assert u.left(3) == 'ALO'
|
||||
assert u.left(0) == ''
|
||||
assert s.left(8) == s
|
||||
assert u.right(3) == 'HA'
|
||||
assert u.right(6) == ''
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user