Commit Graph

11 Commits

Author SHA1 Message Date
Qi Xiao
276fe85bc3 pkg/eval: Improve coverage for builtin_fn_styled.go. 2021-09-10 19:39:20 +01:00
Qi Xiao
4afab8804b Fixup for #1342. 2021-06-27 16:41:07 +01:00
Kurtis Rader
d303c37987 Test more combinations of Text/Segment+num
This fixes the *Segment.Concat and RConcat methods to handle the new
number types. It also adds more tests of concatenation with the "Text"
and "Segment" types with number types.

Related #1340
2021-06-27 16:32:38 +01:00
Qi Xiao
4612b58759 Support exact integer and rational numbers. 2021-04-04 00:58:53 +01:00
Qi Xiao
196eea21d4 Change module import path to src.elv.sh 2021-01-27 01:30:25 +00:00
Kurtis Rader
d52aa03764 In prompts implicitly coerce float64 to string
Including the float64 data type in the prompt value stream causes an error.
This causes those values to be implicitly converted to a string as happens
everywhere else in Elvish.

I initially intended to modify the code to do the implicit string coercion
for any type not otherwise explicitly handled by the pkg/ui `Concat`
methods. I decided against that approach because doing so doesn't make
sense for some types that might appear in the value stream; e.g., Elvish
exceptions.

Fixes #1186
2020-12-25 17:34:49 +00:00
Qi Xiao
90a99c1792 pkg/eval/evaltest: Consolidate all the Throws* methods into one. 2020-09-04 20:31:47 +01:00
Qi Xiao
bb122024dd pkg/eval: Move test framework into new evaltest package. 2020-09-03 06:51:21 +01:00
Qi Xiao
bd2ffa75cc pkg/eval: Make exception matching more explicit.
Don't match implicitly by Cause. Instead, use a new .ThrowsCause method to
explicitly match for the cause.
2020-04-10 20:55:31 +01:00
Qi Xiao
ca945dcb7f pkg/eval: TestCase.Errors{With,} -> Throws{,Any}.
This is in preparation for supporting compilation errors. Also did some
cleanups.
2020-01-08 23:09:19 +00:00
Qi Xiao
e45fdf7228 Move all libraries to new pkg/. 2019-12-23 20:00:59 +00:00