diff --git a/CHANGELOG.md b/CHANGELOG.md index dc0bfc6ef3..ee683020e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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(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* diff --git a/vlib/builtin/string_test.v b/vlib/builtin/string_test.v index 3c8bd0e8ae..9aca92e4af 100644 --- a/vlib/builtin/string_test.v +++ b/vlib/builtin/string_test.v @@ -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) == '' }