Skip to content

Commit

Permalink
Run whole Vector_Spec with java.util.ArrayList
Browse files Browse the repository at this point in the history
  • Loading branch information
JaroslavTulach committed May 11, 2023
1 parent 3dd05c2 commit e380e64
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/Tests/src/Data/Vector_Spec.enso
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ from Standard.Base.Data.Index_Sub_Range.Index_Sub_Range import While, By_Index,
from Standard.Test import Test, Test_Suite
import Standard.Test.Extensions

polyglot java import java.util.ArrayList

type T
Value a b

Expand Down Expand Up @@ -752,7 +754,11 @@ spec =
[True, False, 'a'].pretty . should_equal "[True, False, 'a']"
[Foo.Value True].pretty . should_equal "[(Foo.Value True)]"

type_spec "Use Vector as vectors" (x -> x)
type_spec "Use Array as vectors" (x -> x.to_array)
type_spec "Use Vector as vectors" identity
type_spec "Use Array as vectors" (v -> v.to_array)
type_spec "Use Java ArrayList as vectors" v->
arr = ArrayList.new
v.each (x -> arr.add x)
arr

main = Test_Suite.run_main spec

0 comments on commit e380e64

Please sign in to comment.