Skip to content

Commit e0efc3c

Browse files
committed
fix tests, more signatures
1 parent 3fc114e commit e0efc3c

File tree

3 files changed

+14
-18
lines changed

3 files changed

+14
-18
lines changed

distribution/lib/Standard/Base/0.0.0-dev/src/Data/Text/Extensions.enso

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ Text.find self pattern:(Regex | Text)=".*" case_sensitivity:Case_Sensitivity=..S
300300
## This matches `aABbbbc` @ character 0 and `aBC` @ character 11
301301
"aABbbbccccaaBCaaaa".find_all "a[ab]+c" Case_Sensitivity.Insensitive
302302
Text.find_all : Text -> Case_Sensitivity -> Vector Match ! Regex_Syntax_Error | Illegal_Argument
303-
Text.find_all self pattern=".*" case_sensitivity:Case_Sensitivity=..Sensitive =
303+
Text.find_all self pattern:Text=".*" case_sensitivity:Case_Sensitivity=..Sensitive =
304304
case_insensitive = case_sensitivity.is_case_insensitive_in_memory
305305
compiled_pattern = Regex.compile pattern case_insensitive=case_insensitive
306306
compiled_pattern.match_all self
@@ -335,7 +335,7 @@ Text.find_all self pattern=".*" case_sensitivity:Case_Sensitivity=..Sensitive =
335335
# Evaluates to true
336336
"[email protected]".match regex Case_Sensitivity.Insensitive
337337
Text.match : Text -> Case_Sensitivity -> Boolean ! Regex_Syntax_Error | Illegal_Argument
338-
Text.match self pattern=".*" case_sensitivity:Case_Sensitivity=..Sensitive =
338+
Text.match self pattern:Text=".*" case_sensitivity:Case_Sensitivity=..Sensitive =
339339
case_insensitive = case_sensitivity.is_case_insensitive_in_memory
340340
compiled_pattern = Regex.compile pattern case_insensitive=case_insensitive
341341
compiled_pattern.matches self
@@ -614,7 +614,7 @@ Cleansable_Text.from (that:Text) = Cleansable_Text.Value (pattern->replace_with-
614614

615615
"แมวมีสี่ขา".words == ['แมว', 'มี', 'สี่', 'ขา']
616616
Text.words : Boolean -> Vector Text
617-
Text.words self keep_whitespace=False =
617+
Text.words self (keep_whitespace : Boolean = False) =
618618
iterator = BreakIterator.getWordInstance
619619
iterator.setText self
620620
Vector.build builder->
@@ -657,7 +657,7 @@ Text.words self keep_whitespace=False =
657657

658658
'\na\nb\n'.lines keep_endings=True == ['\n', 'a\n', 'b\n']
659659
Text.lines : Boolean -> Vector Text
660-
Text.lines self keep_endings=False =
660+
Text.lines self (keep_endings : Boolean = False) =
661661
Vector.from_polyglot_array (Text_Utils.split_on_lines self keep_endings)
662662

663663
## GROUP Text
@@ -684,7 +684,7 @@ Text.lines self keep_endings=False =
684684
"Hello World!".insert 5 " Cruel" == "Hello Cruel World!"
685685
"Hello World!".insert -1 " Cruel" == "Hello World! Cruel"
686686
Text.insert : Integer -> Text -> Text ! Index_Out_Of_Bounds
687-
Text.insert self index that =
687+
Text.insert self (index : Integer) (that : Text) =
688688
len = self.length
689689
idx = if index < 0 then len + index + 1 else index
690690
if (idx < 0) || (idx > len) then Error.throw (Index_Out_Of_Bounds.Error index len) else
@@ -903,7 +903,7 @@ Text.from_codepoints codepoints = Text_Utils.from_codepoints codepoints
903903
"Hello!".starts_with "hello" == False
904904
"Hello!".starts_with "hello" Case_Sensitivity.Insensitive == True
905905
Text.starts_with : Text -> Case_Sensitivity -> Boolean
906-
Text.starts_with self prefix case_sensitivity:Case_Sensitivity=..Sensitive = case case_sensitivity of
906+
Text.starts_with self prefix:Text case_sensitivity:Case_Sensitivity=..Sensitive = case case_sensitivity of
907907
Case_Sensitivity.Default -> self.starts_with prefix Case_Sensitivity.Sensitive
908908
Case_Sensitivity.Sensitive -> Text_Utils.starts_with self prefix
909909
Case_Sensitivity.Insensitive locale ->
@@ -933,7 +933,7 @@ Text.starts_with self prefix case_sensitivity:Case_Sensitivity=..Sensitive = cas
933933
"Hello World".ends_with "world" == False
934934
"Hello World".ends_with "world" Case_Sensitivity.Insensitive == True
935935
Text.ends_with : Text -> Case_Sensitivity -> Boolean
936-
Text.ends_with self suffix case_sensitivity:Case_Sensitivity=..Sensitive = case case_sensitivity of
936+
Text.ends_with self suffix:Text case_sensitivity:Case_Sensitivity=..Sensitive = case case_sensitivity of
937937
Case_Sensitivity.Default -> self.ends_with suffix Case_Sensitivity.Sensitive
938938
Case_Sensitivity.Sensitive -> Text_Utils.ends_with self suffix
939939
Case_Sensitivity.Insensitive locale ->
@@ -1004,7 +1004,7 @@ Text.contains self term:Text="" case_sensitivity:Case_Sensitivity=..Sensitive =
10041004

10051005
"Hello " * 2 == "Hello Hello "
10061006
Text.* : Integer -> Text
1007-
Text.* self count = self.repeat count
1007+
Text.* self count:Integer = self.repeat count
10081008

10091009
## GROUP Calculations
10101010
ICON text
@@ -1025,7 +1025,7 @@ Text.* self count = self.repeat count
10251025

10261026
"Hello ".repeat 2 == "Hello Hello "
10271027
Text.repeat : Integer -> Text
1028-
Text.repeat self count=1 =
1028+
Text.repeat self (count : Integer = 1) =
10291029
0.up_to count . fold "" acc-> _-> acc + self
10301030

10311031
## ALIAS first, head, keep, last, left, limit, mid, right, slice, substring, tail, top

test/Base_Tests/src/Data/Vector_Spec.enso

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import Standard.Base.Errors.Common.Index_Out_Of_Bounds
1010
import Standard.Base.Errors.Common.Missing_Argument
1111
import Standard.Base.Errors.Common.Not_Found
1212
import Standard.Base.Errors.Common.Type_Error
13-
import Standard.Base.Errors.Common.Unsupported_Argument_Types
1413
import Standard.Base.Errors.Illegal_Argument.Illegal_Argument
1514
import Standard.Base.Errors.Unimplemented.Unimplemented
1615
import Standard.Base.Runtime.Ref.Ref
@@ -256,17 +255,17 @@ type_spec suite_builder name alter = suite_builder.group name group_builder->
256255
txtvec.filter (..Contains 's\u0301') . should_equal ["ś"]
257256
txtvec.filter (..Contains 'S\u0301' Case_Sensitivity.Sensitive) . should_equal []
258257
txtvec.filter (..Contains 'S\u0301' Case_Sensitivity.Insensitive) . should_equal ["ś"]
259-
Test.expect_panic_with (txtvec.filter (..Contains 42)) Unsupported_Argument_Types
258+
Test.expect_panic Type_Error (txtvec.filter (..Contains 42))
260259
txtvec.filter (..Starts_With "a") . should_equal ["aaa", "abab"]
261260
txtvec.filter (..Starts_With "a" keep_or_remove=Filter_Action.Remove) . should_equal ["bbb", "cccc", "baaa", "ś"]
262261
txtvec.filter (..Starts_With "A" Case_Sensitivity.Sensitive) . should_equal []
263262
txtvec.filter (..Starts_With "A" Case_Sensitivity.Insensitive) . should_equal ["aaa", "abab"]
264-
Test.expect_panic_with (txtvec.filter (..Starts_With 42)) Unsupported_Argument_Types
263+
Test.expect_panic Type_Error (txtvec.filter (..Starts_With 42))
265264
txtvec.filter (..Ends_With "a") . should_equal ["aaa", "baaa"]
266265
txtvec.filter (..Ends_With "a" keep_or_remove=Filter_Action.Remove) . should_equal ["bbb", "abab", "cccc", "ś"]
267266
txtvec.filter (..Ends_With "A" Case_Sensitivity.Sensitive) . should_equal []
268267
txtvec.filter (..Ends_With "A" Case_Sensitivity.Insensitive) . should_equal ["aaa", "baaa"]
269-
Test.expect_panic_with (txtvec.filter (..Ends_With 42)) Unsupported_Argument_Types
268+
Test.expect_panic Type_Error (txtvec.filter (..Ends_With 42))
270269

271270
txtvec.filter (..Less than="a") . should_equal []
272271
txtvec.filter (..Greater than="b") . should_equal ["bbb", "cccc", "baaa", "ś"]

test/Table_Tests/src/Database/Codegen_Spec.enso

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,9 @@ add_specs suite_builder =
4545
q1 = data.t1.filter (data.t1.at "A" == 42) . to_json
4646

4747
part1 = JS_Object.from_pairs [["sql_code", 'SELECT "T1"."A" AS "A", "T1"."B" AS "B", "T1"."C" AS "C" FROM "T1" AS "T1" WHERE (("T1"."A") = (']]
48-
part2_sub = JS_Object.from_pairs [["value", 42]]
49-
part2 = JS_Object.from_pairs [["sql_interpolation", part2_sub]]
48+
part2 = JS_Object.from_pairs [["sql_interpolation", 42]]
5049
part3 = JS_Object.from_pairs [["sql_code", ")) = ("]]
51-
part4_sub = JS_Object.from_pairs [["value", True]]
52-
part4 = JS_Object.from_pairs [["sql_interpolation", part4_sub]]
50+
part4 = JS_Object.from_pairs [["sql_interpolation", True]]
5351
part5 = JS_Object.from_pairs [["sql_code", ")"]]
5452
expected = JS_Object.from_pairs [["query", [part1, part2, part3, part4, part5]]] . to_text
5553
q1.should_equal expected
@@ -168,4 +166,3 @@ main filter=Nothing =
168166
suite = Test.build suite_builder->
169167
add_specs suite_builder
170168
suite.run_with_filter filter
171-

0 commit comments

Comments
 (0)