From e380e647af8547cab99e06c142c46063d4dbd8f6 Mon Sep 17 00:00:00 2001 From: Jaroslav Tulach Date: Thu, 11 May 2023 08:06:41 +0200 Subject: [PATCH] Run whole Vector_Spec with java.util.ArrayList --- test/Tests/src/Data/Vector_Spec.enso | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/Tests/src/Data/Vector_Spec.enso b/test/Tests/src/Data/Vector_Spec.enso index 586ec76064a..f886b5a77f8 100644 --- a/test/Tests/src/Data/Vector_Spec.enso +++ b/test/Tests/src/Data/Vector_Spec.enso @@ -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 @@ -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