Commit graph

5 commits

Author SHA1 Message Date
Sylvestre Ledru
7225fb6c24 expr: Use chars().count() as we can have some multibytes chars
Partially fixes #3132
Fixes one of the test of tests/misc/expr-multibyte
2022-02-13 14:19:25 +01:00
Michael Debertol
d821719c67
expr: support arbitrary precision integers (#2271)
* expr: support arbitrary precision integers

Instead of i64s we now use BigInts for integer operations. This means
that no result or input can be out of range.
The representation of integer flags was changed from i64 to u8 to make
their intention clearer.

* expr: allow big numbers as arguments as well

Also adds some tests

* expr: use num-traits to check bigints for 0 and 1

* expr: remove obsolete refs

match ergonomics made these avoidable.

* formatting

Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
2021-05-29 23:25:23 +02:00
Yağız can Değirmenci
071899d24d tests: delete 'error:' prefix from the tests 2021-05-26 02:45:53 +03:00
Michael Debertol
218f523e1b expr: make substr infallible
Instead of returning an Err it should return the "null string"
(in our case that's the empty string) when the offset or length
is invalid.
2021-05-23 22:22:34 +02:00
Roy Ivy III
de0375f909 tests ~ reorganize tests 2020-06-01 18:30:04 -05:00
Renamed from tests/test_expr.rs (Browse further)