From 06bd69436bc9a42dd2a8b41380015594460005f9 Mon Sep 17 00:00:00 2001 From: Hubert Plociniczak Date: Thu, 1 Dec 2022 11:13:34 +0100 Subject: [PATCH] Import modules' extension methods only with unqualified import statements (#3906) # Important Notes Note that one cannot ``` import Standard.Table as Table_Module ``` because of the 2-component name restriction that gets desugared to `Standard.Table.Main` and we have to write ``` import Standard.Table.Main as Table_Module ``` in a few places. Once we move `Json.to_table` extension this can be improved. --- CHANGELOG.md | 2 + .../Base/0.0.0-dev/src/Data/Vector.enso | 4 +- .../Standard/Table/0.0.0-dev/src/Main.enso | 1 + .../org/enso/interpreter/runtime/Module.java | 15 +++ .../runtime/scope/ModuleScope.java | 102 +++++++++++++++--- .../enso/compiler/codegen/IrToTruffle.scala | 7 +- .../package.yaml | 6 ++ .../src/Atom.enso | 7 ++ .../src/Main.enso | 5 + .../package.yaml | 6 ++ .../src/Atom.enso | 7 ++ .../src/Main.enso | 4 + .../package.yaml | 6 ++ .../src/Atom.enso | 7 ++ .../src/Main.enso | 4 + .../test/semantic/ImportsTest.scala | 14 +++ test/Examples_Tests/src/Examples_Spec.enso | 1 + test/Geo_Tests/src/Geo_Spec.enso | 1 + test/Image_Tests/src/Data/Image_Spec.enso | 1 + test/Image_Tests/src/Data/Matrix_Spec.enso | 1 + test/Image_Tests/src/Image_Read_Spec.enso | 1 + .../src/Aggregate_Column_Spec.enso | 1 + test/Table_Tests/src/Aggregate_Spec.enso | 1 + test/Table_Tests/src/Column_Spec.enso | 1 + test/Table_Tests/src/Common_Table_Spec.enso | 1 + test/Table_Tests/src/Csv_Spec.enso | 2 + test/Table_Tests/src/Data_Formatter_Spec.enso | 1 + .../src/Database/Codegen_Spec.enso | 1 + .../Table_Tests/src/Database/Common_Spec.enso | 1 + .../src/Database/Postgres_Spec.enso | 1 + .../src/Database/Redshift_Spec.enso | 1 + .../Table_Tests/src/Database/SQLite_Spec.enso | 1 + test/Table_Tests/src/Delimited_Read_Spec.enso | 3 + .../Table_Tests/src/Delimited_Write_Spec.enso | 1 + test/Table_Tests/src/Excel_Spec.enso | 1 + test/Table_Tests/src/Expression_Spec.enso | 1 + test/Table_Tests/src/Json_Spec.enso | 2 + test/Table_Tests/src/Parse_Values_Spec.enso | 1 + test/Table_Tests/src/Table_Date_Spec.enso | 2 + test/Table_Tests/src/Table_Spec.enso | 2 + .../src/Table_Time_Of_Day_Spec.enso | 1 + test/Table_Tests/src/Table_Time_Spec.enso | 1 + .../src/Unique_Naming_Strategy_Spec.enso | 1 + test/Table_Tests/src/Util.enso | 1 + test/Tests/src/Data/Array_Polyglot_Spec.enso | 1 + test/Tests/src/Data/Array_Proxy_Spec.enso | 1 + test/Tests/src/Data/Array_Spec.enso | 1 + test/Tests/src/Data/Bool_Spec.enso | 1 + test/Tests/src/Data/Function_Spec.enso | 1 + test/Tests/src/Data/Interval_Spec.enso | 1 + test/Tests/src/Data/Json_Spec.enso | 1 + test/Tests/src/Data/List_Spec.enso | 1 + test/Tests/src/Data/Locale_Spec.enso | 1 + test/Tests/src/Data/Map_Spec.enso | 1 + test/Tests/src/Data/Maybe_Spec.enso | 1 + test/Tests/src/Data/Noise/Generator_Spec.enso | 1 + test/Tests/src/Data/Noise_Spec.enso | 1 + test/Tests/src/Data/Numbers_Spec.enso | 1 + .../src/Data/Ordering/Comparator_Spec.enso | 1 + .../src/Data/Ordering/Natural_Order_Spec.enso | 1 + .../Vector_Lexicographic_Order_Spec.enso | 1 + test/Tests/src/Data/Ordering_Spec.enso | 1 + test/Tests/src/Data/Polyglot_Spec.enso | 1 + test/Tests/src/Data/Range_Spec.enso | 1 + test/Tests/src/Data/Ref_Spec.enso | 1 + test/Tests/src/Data/Regression_Spec.enso | 1 + test/Tests/src/Data/Statistics_Spec.enso | 1 + .../Data/Text/Default_Regex_Engine_Spec.enso | 1 + test/Tests/src/Data/Text/Encoding_Spec.enso | 1 + test/Tests/src/Data/Text/Matching_Spec.enso | 1 + test/Tests/src/Data/Text/Regex_Spec.enso | 1 + test/Tests/src/Data/Text/Span_Spec.enso | 1 + .../src/Data/Text/Text_Sub_Range_Spec.enso | 1 + test/Tests/src/Data/Text/Utils_Spec.enso | 1 + test/Tests/src/Data/Text_Spec.enso | 1 + test/Tests/src/Data/Time/Date_Part_Spec.enso | 1 + test/Tests/src/Data/Time/Date_Spec.enso | 1 + test/Tests/src/Data/Time/Date_Time_Spec.enso | 1 + .../Tests/src/Data/Time/Day_Of_Week_Spec.enso | 1 + test/Tests/src/Data/Time/Duration_Spec.enso | 1 + test/Tests/src/Data/Time/Period_Spec.enso | 1 + test/Tests/src/Data/Time/Spec.enso | 1 + .../Tests/src/Data/Time/Time_Of_Day_Spec.enso | 1 + test/Tests/src/Data/Time/Time_Zone_Spec.enso | 1 + .../src/Data/Vector/Slicing_Helpers_Spec.enso | 1 + test/Tests/src/Data/Vector_Spec.enso | 1 + test/Tests/src/Main.enso | 1 + test/Tests/src/Network/Http/Header_Spec.enso | 1 + test/Tests/src/Network/Http/Request_Spec.enso | 1 + test/Tests/src/Network/Http_Spec.enso | 1 + test/Tests/src/Network/URI_Spec.enso | 1 + test/Tests/src/Random_Spec.enso | 1 + .../src/Runtime/Lazy_Generator_Spec.enso | 1 + .../src/Runtime/Managed_Resource_Spec.enso | 1 + test/Tests/src/Runtime/Stack_Traces_Spec.enso | 1 + test/Tests/src/Semantic/Any_Spec.enso | 1 + test/Tests/src/Semantic/Case_Spec.enso | 1 + test/Tests/src/Semantic/Conversion_Spec.enso | 1 + test/Tests/src/Semantic/Deep_Export/Spec.enso | 1 + .../Tests/src/Semantic/Default_Args_Spec.enso | 1 + test/Tests/src/Semantic/Error_Spec.enso | 1 + test/Tests/src/Semantic/Import_Loop/Spec.enso | 1 + .../Tests/src/Semantic/Java_Interop_Spec.enso | 1 + test/Tests/src/Semantic/Js_Interop_Spec.enso | 1 + .../src/Semantic/Meta_Location_Spec.enso | 3 +- test/Tests/src/Semantic/Meta_Spec.enso | 1 + test/Tests/src/Semantic/Names_Spec.enso | 1 + .../src/Semantic/Python_Interop_Spec.enso | 1 + test/Tests/src/Semantic/R_Interop_Spec.enso | 1 + test/Tests/src/Semantic/Runtime_Spec.enso | 1 + test/Tests/src/Semantic/Self_Type_Spec.enso | 2 +- test/Tests/src/Semantic/Warnings_Spec.enso | 1 + test/Tests/src/System/Environment_Spec.enso | 1 + test/Tests/src/System/File_Read_Spec.enso | 1 + test/Tests/src/System/File_Spec.enso | 1 + test/Tests/src/System/Process_Spec.enso | 1 + .../System/Reporting_Stream_Decoder_Spec.enso | 1 + .../System/Reporting_Stream_Encoder_Spec.enso | 1 + test/Tests/src/System/System_Spec.enso | 1 + .../Visualization_Tests/src/Geo_Map_Spec.enso | 1 + test/Visualization_Tests/src/Helpers.enso | 1 + .../Visualization_Tests/src/Helpers_Spec.enso | 1 + .../src/Histogram_Spec.enso | 1 + test/Visualization_Tests/src/Id_Spec.enso | 1 + test/Visualization_Tests/src/SQL_Spec.enso | 1 + .../src/Scatter_Plot_Spec.enso | 1 + test/Visualization_Tests/src/Table_Spec.enso | 1 + .../src/Visualization_Spec.enso | 1 + 128 files changed, 301 insertions(+), 17 deletions(-) create mode 100644 engine/runtime/src/test/resources/Test_Extension_Methods_Failure/package.yaml create mode 100644 engine/runtime/src/test/resources/Test_Extension_Methods_Failure/src/Atom.enso create mode 100644 engine/runtime/src/test/resources/Test_Extension_Methods_Failure/src/Main.enso create mode 100644 engine/runtime/src/test/resources/Test_Extension_Methods_Success_1/package.yaml create mode 100644 engine/runtime/src/test/resources/Test_Extension_Methods_Success_1/src/Atom.enso create mode 100644 engine/runtime/src/test/resources/Test_Extension_Methods_Success_1/src/Main.enso create mode 100644 engine/runtime/src/test/resources/Test_Extension_Methods_Success_2/package.yaml create mode 100644 engine/runtime/src/test/resources/Test_Extension_Methods_Success_2/src/Atom.enso create mode 100644 engine/runtime/src/test/resources/Test_Extension_Methods_Success_2/src/Main.enso diff --git a/CHANGELOG.md b/CHANGELOG.md index df3aa04c40b..7aa17b5b22d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -456,6 +456,7 @@ - [Add the `Self` keyword referring to current type][3844] - [Support VCS for projects in Language Server][3851] - [Support multiple exports of the same module][3897] +- [Import modules' extension methods only with unqualified imports][3906] - [Don't export polyglot symbols][3915] - [From/all import must not include module in name resolution][3931] @@ -526,6 +527,7 @@ [3844]: https://github.com/enso-org/enso/pull/3844 [3851]: https://github.com/enso-org/enso/pull/3851 [3897]: https://github.com/enso-org/enso/pull/3897 +[3906]: https://github.com/enso-org/enso/pull/3906 [3915]: https://github.com/enso-org/enso/pull/3915 [3931]: https://github.com/enso-org/enso/pull/3931 diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Vector.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Vector.enso index 6708918b189..e4aeed3c04d 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Vector.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Vector.enso @@ -15,8 +15,8 @@ import project.Random from project.Data.Boolean import Boolean, True, False from project.Data.Index_Sub_Range import Index_Sub_Range, take_helper, drop_helper -from project.Data.Json import Json -from project.Data.Range import Range +from project.Data.Json import all +from project.Data.Range import all from project.Error.Common import Error, Panic, Index_Out_Of_Bounds_Error, Index_Out_Of_Bounds_Error_Data, No_Such_Method_Error, No_Such_Method_Error_Data, Illegal_Argument_Error_Data, Incomparable_Values_Error, Type_Error_Data, Unsupported_Argument_Types_Data polyglot java import java.lang.IndexOutOfBoundsException diff --git a/distribution/lib/Standard/Table/0.0.0-dev/src/Main.enso b/distribution/lib/Standard/Table/0.0.0-dev/src/Main.enso index e43a0ec09c9..e3b5a7e25c2 100644 --- a/distribution/lib/Standard/Table/0.0.0-dev/src/Main.enso +++ b/distribution/lib/Standard/Table/0.0.0-dev/src/Main.enso @@ -40,6 +40,7 @@ export project.Excel.Excel_Range.Excel_Range export project.Data.Data_Formatter.Data_Formatter from Standard.Geo.Geo_Json import Object_Type +import Standard.Geo.Geo_Json ## ALIAS To Table diff --git a/engine/runtime/src/main/java/org/enso/interpreter/runtime/Module.java b/engine/runtime/src/main/java/org/enso/interpreter/runtime/Module.java index 0fe3597c5b9..9a2a3140aac 100644 --- a/engine/runtime/src/main/java/org/enso/interpreter/runtime/Module.java +++ b/engine/runtime/src/main/java/org/enso/interpreter/runtime/Module.java @@ -21,6 +21,7 @@ import java.util.List; import java.util.Map; import java.util.WeakHashMap; import java.util.logging.Level; + import org.enso.compiler.ModuleCache; import org.enso.compiler.context.SimpleUpdate; import org.enso.compiler.core.IR; @@ -434,6 +435,20 @@ public final class Module implements TruffleObject { return scope; } + /** + * Returns the runtime scope of this module that filters out only the requested types. If the list + * of requested types is empty, returns the unchanged runtime scope. + * + * @param types a list of types to include in the scope + */ + public ModuleScope getScope(List types) { + if (types.isEmpty()) { + return scope; + } else { + return scope.withTypes(types); + } + } + /** @return the qualified name of this module. */ public QualifiedName getName() { return name; diff --git a/engine/runtime/src/main/java/org/enso/interpreter/runtime/scope/ModuleScope.java b/engine/runtime/src/main/java/org/enso/interpreter/runtime/scope/ModuleScope.java index 512e8193906..279e00cf6bb 100644 --- a/engine/runtime/src/main/java/org/enso/interpreter/runtime/scope/ModuleScope.java +++ b/engine/runtime/src/main/java/org/enso/interpreter/runtime/scope/ModuleScope.java @@ -1,9 +1,7 @@ package org.enso.interpreter.runtime.scope; -import com.oracle.truffle.api.CompilerDirectives; - -import java.util.*; - +import com.oracle.truffle.api.CompilerDirectives.CompilationFinal; +import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary; import com.oracle.truffle.api.interop.TruffleObject; import org.enso.interpreter.runtime.EnsoContext; import org.enso.interpreter.runtime.Module; @@ -12,16 +10,25 @@ import org.enso.interpreter.runtime.data.Type; import org.enso.interpreter.runtime.error.RedefinedMethodException; import org.enso.interpreter.runtime.error.RedefinedConversionException; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; + /** A representation of Enso's per-file top-level scope. */ public final class ModuleScope implements TruffleObject { private final Type associatedType; private final Module module; - private Map polyglotSymbols = new HashMap<>(); - private Map types = new HashMap<>(); - private Map> methods = new HashMap<>(); - private Map> conversions = new HashMap<>(); - private Set imports = new HashSet<>(); - private Set exports = new HashSet<>(); + private Map polyglotSymbols; + private Map types; + private Map> methods; + private Map> conversions; + private Set imports; + private Set exports; /** * Creates a new object of this class. @@ -30,6 +37,12 @@ public final class ModuleScope implements TruffleObject { * @param context the current langauge context */ public ModuleScope(Module module, EnsoContext context) { + this.polyglotSymbols = new HashMap<>(); + this.types = new HashMap<>(); + this.methods = new HashMap<>(); + this.conversions = new HashMap<>(); + this.imports = new HashSet<>(); + this.exports = new HashSet<>(); this.module = module; this.associatedType = Type.createSingleton( @@ -39,6 +52,25 @@ public final class ModuleScope implements TruffleObject { false); } + public ModuleScope( + Module module, + Type associatedType, + Map polyglotSymbols, + Map types, + Map> methods, + Map> conversions, + Set imports, + Set exports) { + this.module = module; + this.associatedType = associatedType; + this.polyglotSymbols = polyglotSymbols; + this.types = types; + this.methods = methods; + this.conversions = conversions; + this.imports = imports; + this.exports = exports; + } + public void registerType(Type type) { types.put(type.getName(), type); } @@ -150,7 +182,7 @@ public final class ModuleScope implements TruffleObject { * @param name the method name. * @return the matching method definition or null if not found. */ - @CompilerDirectives.TruffleBoundary + @TruffleBoundary public Function lookupMethodDefinition(Type type, String name) { Function definedWithAtom = type.getDefinitionScope().getMethodMapFor(type).get(name); if (definedWithAtom != null) { @@ -169,7 +201,7 @@ public final class ModuleScope implements TruffleObject { .orElse(null); } - @CompilerDirectives.TruffleBoundary + @TruffleBoundary public Function lookupConversionDefinition(Type type, Type target) { Function definedWithAtom = type.getDefinitionScope().getConversionsFor(target).get(type); if (definedWithAtom != null) { @@ -262,4 +294,50 @@ public final class ModuleScope implements TruffleObject { conversions = new HashMap<>(); polyglotSymbols = new HashMap<>(); } + + /** + * Create a copy of this `ModuleScope` while taking into account only the provided list of types. + * + * @param typeNames list of types to copy to the new scope + * @return a copy of this scope modulo the requested types + */ + public ModuleScope withTypes(List typeNames) { + Map polyglotSymbols = new HashMap<>(this.polyglotSymbols); + Map requestedTypes = new HashMap<>(this.types); + Map> methods = new HashMap<>(); + Map> conversions = new HashMap<>(); + Set imports = new HashSet<>(this.imports); + Set exports = new HashSet<>(this.exports); + this.types + .entrySet() + .forEach( + entry -> { + if (typeNames.contains(entry.getKey())) { + requestedTypes.put(entry.getKey(), entry.getValue()); + } + }); + Collection validTypes = requestedTypes.values(); + this.methods.forEach( + (tpe, meths) -> { + if (validTypes.contains(tpe)) { + methods.put(tpe, meths); + } + }); + this.conversions.forEach( + (tpe, meths) -> { + if (validTypes.contains(tpe)) { + conversions.put(tpe, meths); + } + }); + + return new ModuleScope( + module, + associatedType, + polyglotSymbols, + requestedTypes, + methods, + conversions, + imports, + exports); + } } diff --git a/engine/runtime/src/main/scala/org/enso/compiler/codegen/IrToTruffle.scala b/engine/runtime/src/main/scala/org/enso/compiler/codegen/IrToTruffle.scala index 275b93ba7d3..3765f3ee646 100644 --- a/engine/runtime/src/main/scala/org/enso/compiler/codegen/IrToTruffle.scala +++ b/engine/runtime/src/main/scala/org/enso/compiler/codegen/IrToTruffle.scala @@ -84,6 +84,7 @@ import scala.annotation.tailrec import scala.collection.mutable import scala.collection.mutable.ArrayBuffer import scala.jdk.OptionConverters._ +import scala.jdk.CollectionConverters._ /** This is an implementation of a codegeneration pass that lowers the Enso * [[IR]] into the truffle [[org.enso.compiler.core.Core.Node]] structures that @@ -178,7 +179,11 @@ class IrToTruffle( imp.target match { case BindingsMap.ResolvedType(_, _) => case ResolvedModule(module) => - moduleScope.addImport(module.unsafeAsModule().getScope) + val mod = module.unsafeAsModule() + val scope: ModuleScope = imp.importDef.onlyNames + .map(only => mod.getScope(only.map(_.name).asJava)) + .getOrElse(mod.getScope()) + moduleScope.addImport(scope) } } diff --git a/engine/runtime/src/test/resources/Test_Extension_Methods_Failure/package.yaml b/engine/runtime/src/test/resources/Test_Extension_Methods_Failure/package.yaml new file mode 100644 index 00000000000..8f91e5b9ad8 --- /dev/null +++ b/engine/runtime/src/test/resources/Test_Extension_Methods_Failure/package.yaml @@ -0,0 +1,6 @@ +name: Test_Extension_Methods_Success +license: APLv2 +enso-version: default +version: "0.0.1" +author: "Enso Team " +maintainer: "Enso Team " diff --git a/engine/runtime/src/test/resources/Test_Extension_Methods_Failure/src/Atom.enso b/engine/runtime/src/test/resources/Test_Extension_Methods_Failure/src/Atom.enso new file mode 100644 index 00000000000..7e8cfb4a19e --- /dev/null +++ b/engine/runtime/src/test/resources/Test_Extension_Methods_Failure/src/Atom.enso @@ -0,0 +1,7 @@ +from Standard.Base.Data.Numbers import Integer + +type Foo + A + B + +Integer.foo self a = 1 + a diff --git a/engine/runtime/src/test/resources/Test_Extension_Methods_Failure/src/Main.enso b/engine/runtime/src/test/resources/Test_Extension_Methods_Failure/src/Main.enso new file mode 100644 index 00000000000..bf3c72c7ff9 --- /dev/null +++ b/engine/runtime/src/test/resources/Test_Extension_Methods_Failure/src/Main.enso @@ -0,0 +1,5 @@ +import project.Atom.Foo +from project.Atom.Foo import A + +main = + 1.foo 41 diff --git a/engine/runtime/src/test/resources/Test_Extension_Methods_Success_1/package.yaml b/engine/runtime/src/test/resources/Test_Extension_Methods_Success_1/package.yaml new file mode 100644 index 00000000000..ab84980a555 --- /dev/null +++ b/engine/runtime/src/test/resources/Test_Extension_Methods_Success_1/package.yaml @@ -0,0 +1,6 @@ +name: Test_Extension_Methods_Success_1 +license: APLv2 +enso-version: default +version: "0.0.1" +author: "Enso Team " +maintainer: "Enso Team " diff --git a/engine/runtime/src/test/resources/Test_Extension_Methods_Success_1/src/Atom.enso b/engine/runtime/src/test/resources/Test_Extension_Methods_Success_1/src/Atom.enso new file mode 100644 index 00000000000..7e8cfb4a19e --- /dev/null +++ b/engine/runtime/src/test/resources/Test_Extension_Methods_Success_1/src/Atom.enso @@ -0,0 +1,7 @@ +from Standard.Base.Data.Numbers import Integer + +type Foo + A + B + +Integer.foo self a = 1 + a diff --git a/engine/runtime/src/test/resources/Test_Extension_Methods_Success_1/src/Main.enso b/engine/runtime/src/test/resources/Test_Extension_Methods_Success_1/src/Main.enso new file mode 100644 index 00000000000..400ef15ca11 --- /dev/null +++ b/engine/runtime/src/test/resources/Test_Extension_Methods_Success_1/src/Main.enso @@ -0,0 +1,4 @@ +import project.Atom + +main = + 1.foo 41 diff --git a/engine/runtime/src/test/resources/Test_Extension_Methods_Success_2/package.yaml b/engine/runtime/src/test/resources/Test_Extension_Methods_Success_2/package.yaml new file mode 100644 index 00000000000..92bef460d9a --- /dev/null +++ b/engine/runtime/src/test/resources/Test_Extension_Methods_Success_2/package.yaml @@ -0,0 +1,6 @@ +name: Test_Extension_Methods_Success_2 +license: APLv2 +enso-version: default +version: "0.0.1" +author: "Enso Team " +maintainer: "Enso Team " diff --git a/engine/runtime/src/test/resources/Test_Extension_Methods_Success_2/src/Atom.enso b/engine/runtime/src/test/resources/Test_Extension_Methods_Success_2/src/Atom.enso new file mode 100644 index 00000000000..7e8cfb4a19e --- /dev/null +++ b/engine/runtime/src/test/resources/Test_Extension_Methods_Success_2/src/Atom.enso @@ -0,0 +1,7 @@ +from Standard.Base.Data.Numbers import Integer + +type Foo + A + B + +Integer.foo self a = 1 + a diff --git a/engine/runtime/src/test/resources/Test_Extension_Methods_Success_2/src/Main.enso b/engine/runtime/src/test/resources/Test_Extension_Methods_Success_2/src/Main.enso new file mode 100644 index 00000000000..9747d1d572a --- /dev/null +++ b/engine/runtime/src/test/resources/Test_Extension_Methods_Success_2/src/Main.enso @@ -0,0 +1,4 @@ +from project.Atom import all + +main = + 1.foo 41 diff --git a/engine/runtime/src/test/scala/org/enso/interpreter/test/semantic/ImportsTest.scala b/engine/runtime/src/test/scala/org/enso/interpreter/test/semantic/ImportsTest.scala index 5fa3194cc34..a742e62d09a 100644 --- a/engine/runtime/src/test/scala/org/enso/interpreter/test/semantic/ImportsTest.scala +++ b/engine/runtime/src/test/scala/org/enso/interpreter/test/semantic/ImportsTest.scala @@ -90,6 +90,20 @@ class ImportsTest extends PackageTest { outLines(3) shouldEqual "(Mk_C 10)" } + "Importing module" should "bring extension methods into the scope " in { + evalTestProject("Test_Extension_Methods_Success_1") shouldEqual 42 + } + + "The unqualified import of a module" should "bring extension methods into the scope " in { + evalTestProject("Test_Extension_Methods_Success_2") shouldEqual 42 + } + + "Importing module's types" should "not bring extension methods into the scope " in { + the[InterpreterException] thrownBy evalTestProject( + "Test_Extension_Methods_Failure" + ) should have message "Method `foo` of 1 (Integer) could not be found." + } + "Compiler" should "detect name conflicts preventing users from importing submodules" in { the[InterpreterException] thrownBy evalTestProject( "TestSubmodulesNameConflict" diff --git a/test/Examples_Tests/src/Examples_Spec.enso b/test/Examples_Tests/src/Examples_Spec.enso index 0cc3d8d53ff..ba67651319f 100644 --- a/test/Examples_Tests/src/Examples_Spec.enso +++ b/test/Examples_Tests/src/Examples_Spec.enso @@ -3,6 +3,7 @@ from Standard.Base import all import Standard.Examples from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions # While we're lacking the ability to run the documentation examples # automatically (#1706), these tests at least check that each of the examples diff --git a/test/Geo_Tests/src/Geo_Spec.enso b/test/Geo_Tests/src/Geo_Spec.enso index 16067a15f6d..69e856468d5 100644 --- a/test/Geo_Tests/src/Geo_Spec.enso +++ b/test/Geo_Tests/src/Geo_Spec.enso @@ -4,6 +4,7 @@ from Standard.Table.Data.Table.Table import Table_Data import Standard.Geo from Standard.Test import Test +import Standard.Test.Extensions spec = Test.group "Geo Points" <| diff --git a/test/Image_Tests/src/Data/Image_Spec.enso b/test/Image_Tests/src/Data/Image_Spec.enso index 8a7d2a3fd1a..649fccca129 100644 --- a/test/Image_Tests/src/Data/Image_Spec.enso +++ b/test/Image_Tests/src/Data/Image_Spec.enso @@ -4,6 +4,7 @@ from Standard.Image import Image, Matrix import Standard.Image.Data.Matrix_Error.Matrix_Error from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions spec = Test.group "Image with 1 channel" <| diff --git a/test/Image_Tests/src/Data/Matrix_Spec.enso b/test/Image_Tests/src/Data/Matrix_Spec.enso index 0ab0ff91e55..5973f14621a 100644 --- a/test/Image_Tests/src/Data/Matrix_Spec.enso +++ b/test/Image_Tests/src/Data/Matrix_Spec.enso @@ -4,6 +4,7 @@ from Standard.Image import Matrix import Standard.Image.Data.Matrix_Error.Matrix_Error from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions spec = Test.group "Matrix_Error" <| diff --git a/test/Image_Tests/src/Image_Read_Spec.enso b/test/Image_Tests/src/Image_Read_Spec.enso index b6e86bbdd9d..36edf20f413 100644 --- a/test/Image_Tests/src/Image_Read_Spec.enso +++ b/test/Image_Tests/src/Image_Read_Spec.enso @@ -3,6 +3,7 @@ from Standard.Base import all from Standard.Image import Image, Read_Flag, Write_Flag from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions polyglot java import java.lang.System as Java_System diff --git a/test/Table_Tests/src/Aggregate_Column_Spec.enso b/test/Table_Tests/src/Aggregate_Column_Spec.enso index ccd6f5045f8..78059ea2050 100644 --- a/test/Table_Tests/src/Aggregate_Column_Spec.enso +++ b/test/Table_Tests/src/Aggregate_Column_Spec.enso @@ -7,6 +7,7 @@ import Standard.Table.Internal.Aggregate_Column_Helper import Standard.Table.Internal.Problem_Builder.Problem_Builder from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions spec = Test.group "Aggregate Columns" <| simple_table = Table.new [["count", [1, 2, Nothing, 3, Nothing]], ["is_valid", [Nothing, False, True, False, Nothing]], ["float", [3.4, 1, 5.6, 2.1, Nothing]], ["text", ["A", "", Nothing, "B,C", Nothing]]] diff --git a/test/Table_Tests/src/Aggregate_Spec.enso b/test/Table_Tests/src/Aggregate_Spec.enso index e5e9ed7da0c..72af6be07e8 100644 --- a/test/Table_Tests/src/Aggregate_Spec.enso +++ b/test/Table_Tests/src/Aggregate_Spec.enso @@ -7,6 +7,7 @@ from Standard.Table.Errors import Missing_Input_Columns_Data, Column_Indexes_Out from Standard.Database.Errors import Unsupported_Database_Operation_Error_Data from Standard.Test import Test, Test_Suite, Problems +import Standard.Test.Extensions polyglot java import java.lang.Double diff --git a/test/Table_Tests/src/Column_Spec.enso b/test/Table_Tests/src/Column_Spec.enso index ce27c36c333..310d85049f5 100644 --- a/test/Table_Tests/src/Column_Spec.enso +++ b/test/Table_Tests/src/Column_Spec.enso @@ -5,6 +5,7 @@ import Standard.Table.Data.Storage.Storage import Standard.Examples from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions polyglot java import org.enso.table.data.column.storage.Storage as Java_Storage diff --git a/test/Table_Tests/src/Common_Table_Spec.enso b/test/Table_Tests/src/Common_Table_Spec.enso index d70a61e7403..e36c281cc33 100644 --- a/test/Table_Tests/src/Common_Table_Spec.enso +++ b/test/Table_Tests/src/Common_Table_Spec.enso @@ -12,6 +12,7 @@ from Standard.Table.Errors import all from Standard.Database.Errors import SQL_Error_Data, Unsupported_Database_Operation_Error_Data from Standard.Test import Test, Problems +import Standard.Test.Extensions from project.Util import all diff --git a/test/Table_Tests/src/Csv_Spec.enso b/test/Table_Tests/src/Csv_Spec.enso index b965a796e63..e1953efc628 100644 --- a/test/Table_Tests/src/Csv_Spec.enso +++ b/test/Table_Tests/src/Csv_Spec.enso @@ -1,8 +1,10 @@ from Standard.Base import all from Standard.Table import Table, Column, Delimited, Column_Selector +import Standard.Table.Main as Table_Module from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions from project.Util import all diff --git a/test/Table_Tests/src/Data_Formatter_Spec.enso b/test/Table_Tests/src/Data_Formatter_Spec.enso index 6dfe1db15f6..17e5d4171b7 100644 --- a/test/Table_Tests/src/Data_Formatter_Spec.enso +++ b/test/Table_Tests/src/Data_Formatter_Spec.enso @@ -4,6 +4,7 @@ from Standard.Table import Table, Column, Data_Formatter, Quote_Style from Standard.Table.Errors import all from Standard.Test import Test, Test_Suite, Problems +import Standard.Test.Extensions type Custom_Type Value field diff --git a/test/Table_Tests/src/Database/Codegen_Spec.enso b/test/Table_Tests/src/Database/Codegen_Spec.enso index b257d267a29..e7acc092ec3 100644 --- a/test/Table_Tests/src/Database/Codegen_Spec.enso +++ b/test/Table_Tests/src/Database/Codegen_Spec.enso @@ -11,6 +11,7 @@ from Standard.Database.Data.Table import combine_names, fresh_names from Standard.Database.Errors import Unsupported_Database_Operation_Error_Data from Standard.Test import Test, Test_Suite, Problems +import Standard.Test.Extensions import project.Database.Helpers.Fake_Test_Connection diff --git a/test/Table_Tests/src/Database/Common_Spec.enso b/test/Table_Tests/src/Database/Common_Spec.enso index 841d3ca3a08..9e92036008f 100644 --- a/test/Table_Tests/src/Database/Common_Spec.enso +++ b/test/Table_Tests/src/Database/Common_Spec.enso @@ -8,6 +8,7 @@ from Standard.Database import all from Standard.Database.Errors import Unsupported_Database_Operation_Error_Data from Standard.Test import Test, Problems +import Standard.Test.Extensions import project.Database.Helpers.Name_Generator diff --git a/test/Table_Tests/src/Database/Postgres_Spec.enso b/test/Table_Tests/src/Database/Postgres_Spec.enso index dbc4a492232..44f6cc1498e 100644 --- a/test/Table_Tests/src/Database/Postgres_Spec.enso +++ b/test/Table_Tests/src/Database/Postgres_Spec.enso @@ -11,6 +11,7 @@ import Standard.Database.Data.SQL_Type.SQL_Type import Standard.Database.Internal.Postgres.Pgpass from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions import Standard.Test.Test_Environment import project.Database.Common_Spec diff --git a/test/Table_Tests/src/Database/Redshift_Spec.enso b/test/Table_Tests/src/Database/Redshift_Spec.enso index 73dbed40c6a..8fbfa26526e 100644 --- a/test/Table_Tests/src/Database/Redshift_Spec.enso +++ b/test/Table_Tests/src/Database/Redshift_Spec.enso @@ -6,6 +6,7 @@ from Standard.Table import Table from Standard.Database import Database, Redshift, AWS_Credential, SQL_Query from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions import project.Database.Common_Spec import project.Database.Helpers.Name_Generator diff --git a/test/Table_Tests/src/Database/SQLite_Spec.enso b/test/Table_Tests/src/Database/SQLite_Spec.enso index 4b792fb6c11..650be5df9e7 100644 --- a/test/Table_Tests/src/Database/SQLite_Spec.enso +++ b/test/Table_Tests/src/Database/SQLite_Spec.enso @@ -7,6 +7,7 @@ from Standard.Database import Database, SQLite, In_Memory, SQL_Query from Standard.Database.Errors import SQL_Error_Data from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions import project.Database.Common_Spec import project.Database.Helpers.Name_Generator diff --git a/test/Table_Tests/src/Delimited_Read_Spec.enso b/test/Table_Tests/src/Delimited_Read_Spec.enso index 8ec373a457b..9c1cc2f9c9f 100644 --- a/test/Table_Tests/src/Delimited_Read_Spec.enso +++ b/test/Table_Tests/src/Delimited_Read_Spec.enso @@ -1,9 +1,12 @@ from Standard.Base import all from Standard.Table import Table, Column, Data_Formatter, Quote_Style, Delimited +import Standard.Table.Data.Table_Conversions +import Standard.Table.Main as Table_Module from Standard.Table.Errors import all from Standard.Test import Test, Test_Suite, Problems +import Standard.Test.Extensions import project.Util diff --git a/test/Table_Tests/src/Delimited_Write_Spec.enso b/test/Table_Tests/src/Delimited_Write_Spec.enso index b610e145c48..b6cbb92029a 100644 --- a/test/Table_Tests/src/Delimited_Write_Spec.enso +++ b/test/Table_Tests/src/Delimited_Write_Spec.enso @@ -4,6 +4,7 @@ from Standard.Table import Table, Column, Data_Formatter, Quote_Style, Column_Na from Standard.Table.Errors import all from Standard.Test import Test, Test_Suite, Problems +import Standard.Test.Extensions from project.Util import all diff --git a/test/Table_Tests/src/Excel_Spec.enso b/test/Table_Tests/src/Excel_Spec.enso index 2523061d987..b3100104a6d 100644 --- a/test/Table_Tests/src/Excel_Spec.enso +++ b/test/Table_Tests/src/Excel_Spec.enso @@ -5,6 +5,7 @@ from Standard.Table import Table, Match_Columns, Column_Name_Mapping, Excel, Exc from Standard.Table.Errors import Invalid_Output_Column_Names_Data, Duplicate_Output_Column_Names_Data, Invalid_Location_Data, Range_Exceeded_Data, Existing_Data_Data, Column_Count_Mismatch_Data, Column_Name_Mismatch_Data from Standard.Test import Test, Test_Suite, Problems +import Standard.Test.Extensions import Standard.Examples diff --git a/test/Table_Tests/src/Expression_Spec.enso b/test/Table_Tests/src/Expression_Spec.enso index 77a8b4c08db..2fc52b2bcd1 100644 --- a/test/Table_Tests/src/Expression_Spec.enso +++ b/test/Table_Tests/src/Expression_Spec.enso @@ -6,6 +6,7 @@ import Standard.Table.Data.Expression.Expression_Error import Standard.Visualization from Standard.Test import Test, Test_Suite, Problems +import Standard.Test.Extensions import project.Common_Table_Spec from project.Util import all diff --git a/test/Table_Tests/src/Json_Spec.enso b/test/Table_Tests/src/Json_Spec.enso index 0b9d1bbc903..a7b95755b9b 100644 --- a/test/Table_Tests/src/Json_Spec.enso +++ b/test/Table_Tests/src/Json_Spec.enso @@ -1,7 +1,9 @@ from Standard.Base import all from Standard.Table import Table +import Standard.Table.Main as Table_Module from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions import project.Util diff --git a/test/Table_Tests/src/Parse_Values_Spec.enso b/test/Table_Tests/src/Parse_Values_Spec.enso index c9a0869d68b..e2fa4a7ac7e 100644 --- a/test/Table_Tests/src/Parse_Values_Spec.enso +++ b/test/Table_Tests/src/Parse_Values_Spec.enso @@ -8,6 +8,7 @@ from Standard.Table.Errors import Invalid_Format, Leading_Zeros, Missing_Input_C import Standard.Visualization from Standard.Test import Test, Test_Suite, Problems +import Standard.Test.Extensions spec = Test.group "Table.parse_values" <| Test.specify "should correctly parse integers" <| diff --git a/test/Table_Tests/src/Table_Date_Spec.enso b/test/Table_Tests/src/Table_Date_Spec.enso index 7b6040e5aae..299b1ee1db1 100644 --- a/test/Table_Tests/src/Table_Date_Spec.enso +++ b/test/Table_Tests/src/Table_Date_Spec.enso @@ -1,9 +1,11 @@ from Standard.Base import all from Standard.Table import Table, Column, Delimited, Data_Formatter +import Standard.Table.Data.Table_Conversions import Standard.Table.Data.Storage.Storage from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions from project.Util import all spec = diff --git a/test/Table_Tests/src/Table_Spec.enso b/test/Table_Tests/src/Table_Spec.enso index 0a9c244ee4b..571af918f8d 100644 --- a/test/Table_Tests/src/Table_Spec.enso +++ b/test/Table_Tests/src/Table_Spec.enso @@ -1,6 +1,7 @@ from Standard.Base import all from Standard.Table import Table, Column, Sort_Column, Column_Selector, Sort_Column_Selector, Aggregate_Column +import Standard.Table.Main as Table_Module from Standard.Table.Data.Aggregate_Column.Aggregate_Column import all hiding First, Last from Standard.Table.Data.Table import Empty_Error from Standard.Table.Data.Storage import Storage @@ -10,6 +11,7 @@ from Standard.Table.Errors import Invalid_Output_Column_Names_Data, Duplicate_Ou import Standard.Visualization from Standard.Test import Test, Test_Suite, Problems +import Standard.Test.Extensions import project.Common_Table_Spec from project.Util import all diff --git a/test/Table_Tests/src/Table_Time_Of_Day_Spec.enso b/test/Table_Tests/src/Table_Time_Of_Day_Spec.enso index 485929af5a0..155287d469c 100644 --- a/test/Table_Tests/src/Table_Time_Of_Day_Spec.enso +++ b/test/Table_Tests/src/Table_Time_Of_Day_Spec.enso @@ -4,6 +4,7 @@ from Standard.Table import Table, Delimited, Column, Data_Formatter import Standard.Table.Data.Storage from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions from project.Util import all diff --git a/test/Table_Tests/src/Table_Time_Spec.enso b/test/Table_Tests/src/Table_Time_Spec.enso index 1021bbdcc9c..946ec7a8b04 100644 --- a/test/Table_Tests/src/Table_Time_Spec.enso +++ b/test/Table_Tests/src/Table_Time_Spec.enso @@ -4,6 +4,7 @@ from Standard.Table import Table, Delimited, Column, Data_Formatter import Standard.Table.Data.Storage from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions from project.Util import all diff --git a/test/Table_Tests/src/Unique_Naming_Strategy_Spec.enso b/test/Table_Tests/src/Unique_Naming_Strategy_Spec.enso index 00314a07802..a56d5b9ebf9 100644 --- a/test/Table_Tests/src/Unique_Naming_Strategy_Spec.enso +++ b/test/Table_Tests/src/Unique_Naming_Strategy_Spec.enso @@ -3,6 +3,7 @@ from Standard.Base import all import Standard.Table.Internal.Unique_Name_Strategy.Unique_Name_Strategy from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions spec = Test.group 'Unique_Name_Strategy Helper' <| Test.specify 'should change an empty name to "Column"' <| diff --git a/test/Table_Tests/src/Util.enso b/test/Table_Tests/src/Util.enso index 257ea04cbe0..1bb4fd73aee 100644 --- a/test/Table_Tests/src/Util.enso +++ b/test/Table_Tests/src/Util.enso @@ -3,6 +3,7 @@ from Standard.Base import all from Standard.Table import Table, Column from Standard.Test import Test +import Standard.Test.Extensions Table.should_equal self expected = self_cols = self.columns diff --git a/test/Tests/src/Data/Array_Polyglot_Spec.enso b/test/Tests/src/Data/Array_Polyglot_Spec.enso index 3db284bee84..5ab95174f4e 100644 --- a/test/Tests/src/Data/Array_Polyglot_Spec.enso +++ b/test/Tests/src/Data/Array_Polyglot_Spec.enso @@ -1,6 +1,7 @@ from Standard.Base import all from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions spec = Test.group "JavaScript Objects, Arrays & Functions" <| diff --git a/test/Tests/src/Data/Array_Proxy_Spec.enso b/test/Tests/src/Data/Array_Proxy_Spec.enso index 71c95200350..3777db5587c 100644 --- a/test/Tests/src/Data/Array_Proxy_Spec.enso +++ b/test/Tests/src/Data/Array_Proxy_Spec.enso @@ -2,6 +2,7 @@ from Standard.Base import all from Standard.Base.Data.Array_Proxy import Array_Proxy from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions type Proxy_Object Value length diff --git a/test/Tests/src/Data/Array_Spec.enso b/test/Tests/src/Data/Array_Spec.enso index 49b94447a74..7e1c2b6cd13 100644 --- a/test/Tests/src/Data/Array_Spec.enso +++ b/test/Tests/src/Data/Array_Spec.enso @@ -1,6 +1,7 @@ from Standard.Base import all from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions polyglot java import java.util.LinkedHashSet diff --git a/test/Tests/src/Data/Bool_Spec.enso b/test/Tests/src/Data/Bool_Spec.enso index 731ecc830ab..7f715539891 100644 --- a/test/Tests/src/Data/Bool_Spec.enso +++ b/test/Tests/src/Data/Bool_Spec.enso @@ -1,6 +1,7 @@ from Standard.Base import all from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions Boolean.method self = self diff --git a/test/Tests/src/Data/Function_Spec.enso b/test/Tests/src/Data/Function_Spec.enso index 2ca5b2fe7cc..05290ea3a1e 100644 --- a/test/Tests/src/Data/Function_Spec.enso +++ b/test/Tests/src/Data/Function_Spec.enso @@ -1,6 +1,7 @@ from Standard.Base import all from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions spec = Test.group "identity" <| diff --git a/test/Tests/src/Data/Interval_Spec.enso b/test/Tests/src/Data/Interval_Spec.enso index 58d77148e89..5c0978268d8 100644 --- a/test/Tests/src/Data/Interval_Spec.enso +++ b/test/Tests/src/Data/Interval_Spec.enso @@ -1,6 +1,7 @@ from Standard.Base import all from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions spec = Test.group "Bound" <| diff --git a/test/Tests/src/Data/Json_Spec.enso b/test/Tests/src/Data/Json_Spec.enso index 16f5c72aaff..0eb6d2f132d 100644 --- a/test/Tests/src/Data/Json_Spec.enso +++ b/test/Tests/src/Data/Json_Spec.enso @@ -2,6 +2,7 @@ from Standard.Base import all from Standard.Base.Data.Json import Json_Parse_Error, No_Such_Field from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions import Standard.Test.Test_Result.Test_Result type Author diff --git a/test/Tests/src/Data/List_Spec.enso b/test/Tests/src/Data/List_Spec.enso index 3f871905c66..f74549469e0 100644 --- a/test/Tests/src/Data/List_Spec.enso +++ b/test/Tests/src/Data/List_Spec.enso @@ -3,6 +3,7 @@ import Standard.Base.Runtime.State from Standard.Base.Data.List import Empty_Error from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions spec = Test.group "List" <| l = List.Cons 1 <| List.Cons 2 <| List.Cons 3 <| List.Nil diff --git a/test/Tests/src/Data/Locale_Spec.enso b/test/Tests/src/Data/Locale_Spec.enso index ac477893fac..37646bd99ca 100644 --- a/test/Tests/src/Data/Locale_Spec.enso +++ b/test/Tests/src/Data/Locale_Spec.enso @@ -3,6 +3,7 @@ from Standard.Base import all polyglot java import java.util.Locale as JavaLocale from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions with_locale locale ~test = default_locale = JavaLocale.getDefault diff --git a/test/Tests/src/Data/Map_Spec.enso b/test/Tests/src/Data/Map_Spec.enso index 6c1324540f1..3cd1230de0c 100644 --- a/test/Tests/src/Data/Map_Spec.enso +++ b/test/Tests/src/Data/Map_Spec.enso @@ -3,6 +3,7 @@ from Standard.Base import all from Standard.Base.Data.Map import No_Value_For_Key from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions spec = Test.group "Maps" <| m = Map.empty . insert 1 2 . insert 2 4 diff --git a/test/Tests/src/Data/Maybe_Spec.enso b/test/Tests/src/Data/Maybe_Spec.enso index 5546a87119f..467148bdbd9 100644 --- a/test/Tests/src/Data/Maybe_Spec.enso +++ b/test/Tests/src/Data/Maybe_Spec.enso @@ -1,6 +1,7 @@ from Standard.Base import all from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions spec = Test.group "Maybe" <| Test.specify "should have a None variant" <| diff --git a/test/Tests/src/Data/Noise/Generator_Spec.enso b/test/Tests/src/Data/Noise/Generator_Spec.enso index 684ed856e2e..ef301593449 100644 --- a/test/Tests/src/Data/Noise/Generator_Spec.enso +++ b/test/Tests/src/Data/Noise/Generator_Spec.enso @@ -5,6 +5,7 @@ import Standard.Base.Data.Noise.Deterministic_Random import Standard.Base.Error.Common from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions spec = Test.group "Generator Interface" <| diff --git a/test/Tests/src/Data/Noise_Spec.enso b/test/Tests/src/Data/Noise_Spec.enso index e4f3bbe077b..65664cd4e4b 100644 --- a/test/Tests/src/Data/Noise_Spec.enso +++ b/test/Tests/src/Data/Noise_Spec.enso @@ -1,6 +1,7 @@ from Standard.Base import all from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions type My_Generator My_Generator.step self _ _ = 1 diff --git a/test/Tests/src/Data/Numbers_Spec.enso b/test/Tests/src/Data/Numbers_Spec.enso index dc17d172c51..131b9b4fb41 100644 --- a/test/Tests/src/Data/Numbers_Spec.enso +++ b/test/Tests/src/Data/Numbers_Spec.enso @@ -3,6 +3,7 @@ from Standard.Base import all from Standard.Base.Data.Numbers import Number_Parse_Error from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions Integer.is_even self = self % 2 == 0 diff --git a/test/Tests/src/Data/Ordering/Comparator_Spec.enso b/test/Tests/src/Data/Ordering/Comparator_Spec.enso index ce3c9099d7a..fa031454819 100644 --- a/test/Tests/src/Data/Ordering/Comparator_Spec.enso +++ b/test/Tests/src/Data/Ordering/Comparator_Spec.enso @@ -5,6 +5,7 @@ import Standard.Base.Data.Ordering.Comparator polyglot java import java.lang.ClassCastException from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions # === Test Resources === diff --git a/test/Tests/src/Data/Ordering/Natural_Order_Spec.enso b/test/Tests/src/Data/Ordering/Natural_Order_Spec.enso index 52a6a52b5e2..0df23dfae79 100644 --- a/test/Tests/src/Data/Ordering/Natural_Order_Spec.enso +++ b/test/Tests/src/Data/Ordering/Natural_Order_Spec.enso @@ -1,6 +1,7 @@ from Standard.Base import all from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions spec = Test.group "Natural Order" <| case_insensitive_compare a b = Natural_Order.compare a b Case_Sensitivity.Insensitive diff --git a/test/Tests/src/Data/Ordering/Vector_Lexicographic_Order_Spec.enso b/test/Tests/src/Data/Ordering/Vector_Lexicographic_Order_Spec.enso index 63e8cc4ce9f..4349cfcec0f 100644 --- a/test/Tests/src/Data/Ordering/Vector_Lexicographic_Order_Spec.enso +++ b/test/Tests/src/Data/Ordering/Vector_Lexicographic_Order_Spec.enso @@ -3,6 +3,7 @@ from Standard.Base import all import Standard.Base.Data.Ordering.Vector_Lexicographic_Order from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions type My_Type Value a b diff --git a/test/Tests/src/Data/Ordering_Spec.enso b/test/Tests/src/Data/Ordering_Spec.enso index 6664fc0487c..4d0624c58e7 100644 --- a/test/Tests/src/Data/Ordering_Spec.enso +++ b/test/Tests/src/Data/Ordering_Spec.enso @@ -1,6 +1,7 @@ from Standard.Base import all from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions # === Test Resources === diff --git a/test/Tests/src/Data/Polyglot_Spec.enso b/test/Tests/src/Data/Polyglot_Spec.enso index 50a32bd5775..3effbc519f3 100644 --- a/test/Tests/src/Data/Polyglot_Spec.enso +++ b/test/Tests/src/Data/Polyglot_Spec.enso @@ -1,6 +1,7 @@ from Standard.Base import all from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions polyglot java import java.time.LocalDate polyglot java import java.lang.String diff --git a/test/Tests/src/Data/Range_Spec.enso b/test/Tests/src/Data/Range_Spec.enso index b3f5fa17c21..451aa35842e 100644 --- a/test/Tests/src/Data/Range_Spec.enso +++ b/test/Tests/src/Data/Range_Spec.enso @@ -3,6 +3,7 @@ from Standard.Base import all import Standard.Base.Runtime.Ref.Ref from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions spec = Test.group "Range" <| Test.specify "should be created with a start, an end and a step" <| diff --git a/test/Tests/src/Data/Ref_Spec.enso b/test/Tests/src/Data/Ref_Spec.enso index c41f0414f6d..1827d1b6d8e 100644 --- a/test/Tests/src/Data/Ref_Spec.enso +++ b/test/Tests/src/Data/Ref_Spec.enso @@ -3,6 +3,7 @@ from Standard.Base import all import Standard.Base.Runtime.Ref.Ref from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions spec = Test.group "Refs" <| Test.specify "should be able to store and retrieve value in references" <| diff --git a/test/Tests/src/Data/Regression_Spec.enso b/test/Tests/src/Data/Regression_Spec.enso index dd204c3372c..725ebc47f68 100644 --- a/test/Tests/src/Data/Regression_Spec.enso +++ b/test/Tests/src/Data/Regression_Spec.enso @@ -1,6 +1,7 @@ from Standard.Base import Nothing, Vector, Number, Decimal, True, Illegal_Argument_Error_Data, False, Regression from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions spec = ## Regression test data produced using an Excel spreadsheet. diff --git a/test/Tests/src/Data/Statistics_Spec.enso b/test/Tests/src/Data/Statistics_Spec.enso index e8d8e19e918..d465f91de76 100644 --- a/test/Tests/src/Data/Statistics_Spec.enso +++ b/test/Tests/src/Data/Statistics_Spec.enso @@ -2,6 +2,7 @@ from Standard.Base import all from Standard.Base.Data.Vector import Empty_Error from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions # === Test Resources === diff --git a/test/Tests/src/Data/Text/Default_Regex_Engine_Spec.enso b/test/Tests/src/Data/Text/Default_Regex_Engine_Spec.enso index 1be9cb92e49..8e3b2208558 100644 --- a/test/Tests/src/Data/Text/Default_Regex_Engine_Spec.enso +++ b/test/Tests/src/Data/Text/Default_Regex_Engine_Spec.enso @@ -7,6 +7,7 @@ import Standard.Base.Data.Text.Regex.Option as Global_Option polyglot java import java.util.regex.Pattern as Java_Pattern from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions default_mask = Java_Pattern.CANON_EQ.bit_or Java_Pattern.UNICODE_CASE . bit_or Java_Pattern.UNICODE_CHARACTER_CLASS diff --git a/test/Tests/src/Data/Text/Encoding_Spec.enso b/test/Tests/src/Data/Text/Encoding_Spec.enso index 383c3842529..f7b8fbdb890 100644 --- a/test/Tests/src/Data/Text/Encoding_Spec.enso +++ b/test/Tests/src/Data/Text/Encoding_Spec.enso @@ -3,6 +3,7 @@ from Standard.Base import all from Standard.Base.Data.Text.Encoding import all_character_sets, all_encodings, Encoding from Standard.Test import Test, Test_Suite, Problems +import Standard.Test.Extensions spec = Test.group "Encoding object" <| diff --git a/test/Tests/src/Data/Text/Matching_Spec.enso b/test/Tests/src/Data/Text/Matching_Spec.enso index a34ca719d9b..121039328e8 100644 --- a/test/Tests/src/Data/Text/Matching_Spec.enso +++ b/test/Tests/src/Data/Text/Matching_Spec.enso @@ -1,6 +1,7 @@ from Standard.Base import all from Standard.Test import Test, Test_Suite, Problems +import Standard.Test.Extensions type Foo_Error diff --git a/test/Tests/src/Data/Text/Regex_Spec.enso b/test/Tests/src/Data/Text/Regex_Spec.enso index 36a23e09004..f51d8f0f3aa 100644 --- a/test/Tests/src/Data/Text/Regex_Spec.enso +++ b/test/Tests/src/Data/Text/Regex_Spec.enso @@ -4,6 +4,7 @@ import Standard.Base.Data.Text.Regex.Option import Standard.Base.Data.Text.Regex.Engine.Default as Default_Engine from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions spec = Test.group "Regex options handling" <| diff --git a/test/Tests/src/Data/Text/Span_Spec.enso b/test/Tests/src/Data/Text/Span_Spec.enso index b854edc4999..6b835b20f1a 100644 --- a/test/Tests/src/Data/Text/Span_Spec.enso +++ b/test/Tests/src/Data/Text/Span_Spec.enso @@ -2,6 +2,7 @@ from Standard.Base import all from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions spec = Test.group "Text.Span" <| diff --git a/test/Tests/src/Data/Text/Text_Sub_Range_Spec.enso b/test/Tests/src/Data/Text/Text_Sub_Range_Spec.enso index 649547b93d2..dba8c9b918a 100644 --- a/test/Tests/src/Data/Text/Text_Sub_Range_Spec.enso +++ b/test/Tests/src/Data/Text/Text_Sub_Range_Spec.enso @@ -3,6 +3,7 @@ from Standard.Base import all from Standard.Base.Data.Text.Text_Sub_Range import all from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions spec = Test.group "Text_Sub_Range_Data" <| Test.specify "should correctly split a text into grapheme cluster ranges expressed in codepoint indices" <| diff --git a/test/Tests/src/Data/Text/Utils_Spec.enso b/test/Tests/src/Data/Text/Utils_Spec.enso index cf04c772095..89d1a539dd5 100644 --- a/test/Tests/src/Data/Text/Utils_Spec.enso +++ b/test/Tests/src/Data/Text/Utils_Spec.enso @@ -5,6 +5,7 @@ polyglot java import org.enso.base.text.CaseFoldedString polyglot java import com.ibm.icu.text.BreakIterator from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions spec = Test.group "Text_Utils" <| diff --git a/test/Tests/src/Data/Text_Spec.enso b/test/Tests/src/Data/Text_Spec.enso index 7ffe43a1834..29f8f7bbc7b 100644 --- a/test/Tests/src/Data/Text_Spec.enso +++ b/test/Tests/src/Data/Text_Spec.enso @@ -7,6 +7,7 @@ from Standard.Base.Data.Text.Text_Sub_Range.Text_Sub_Range import all from Standard.Base.Data.Index_Sub_Range.Index_Sub_Range import all from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions type Auto Value a diff --git a/test/Tests/src/Data/Time/Date_Part_Spec.enso b/test/Tests/src/Data/Time/Date_Part_Spec.enso index cc537eb7c45..61178f8be9e 100644 --- a/test/Tests/src/Data/Time/Date_Part_Spec.enso +++ b/test/Tests/src/Data/Time/Date_Part_Spec.enso @@ -1,6 +1,7 @@ from Standard.Base import all from Standard.Test import Test +import Standard.Test.Extensions spec name create_new_date = Test.group (name + "date part tests") <| diff --git a/test/Tests/src/Data/Time/Date_Spec.enso b/test/Tests/src/Data/Time/Date_Spec.enso index 0656219f0ef..192c063ae27 100644 --- a/test/Tests/src/Data/Time/Date_Spec.enso +++ b/test/Tests/src/Data/Time/Date_Spec.enso @@ -3,6 +3,7 @@ from Standard.Base import all from Standard.Base.Error.Common import Time_Error from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions import project.Data.Time.Date_Part_Spec diff --git a/test/Tests/src/Data/Time/Date_Time_Spec.enso b/test/Tests/src/Data/Time/Date_Time_Spec.enso index 8543bf3b96a..9dc8170666c 100644 --- a/test/Tests/src/Data/Time/Date_Time_Spec.enso +++ b/test/Tests/src/Data/Time/Date_Time_Spec.enso @@ -1,6 +1,7 @@ from Standard.Base import all from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions import project.Data.Time.Date_Part_Spec diff --git a/test/Tests/src/Data/Time/Day_Of_Week_Spec.enso b/test/Tests/src/Data/Time/Day_Of_Week_Spec.enso index e49b6888ea6..b7c8d8ae231 100644 --- a/test/Tests/src/Data/Time/Day_Of_Week_Spec.enso +++ b/test/Tests/src/Data/Time/Day_Of_Week_Spec.enso @@ -1,6 +1,7 @@ from Standard.Base import all from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions spec = Test.group "Day_Of_Week conversions" <| diff --git a/test/Tests/src/Data/Time/Duration_Spec.enso b/test/Tests/src/Data/Time/Duration_Spec.enso index de17d95fc62..f412face5d1 100644 --- a/test/Tests/src/Data/Time/Duration_Spec.enso +++ b/test/Tests/src/Data/Time/Duration_Spec.enso @@ -1,6 +1,7 @@ from Standard.Base import all from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions polyglot java import java.time.Duration as Java_Duration polyglot java import java.time.LocalDate diff --git a/test/Tests/src/Data/Time/Period_Spec.enso b/test/Tests/src/Data/Time/Period_Spec.enso index 3b5a7acbc16..80ebeef9ac6 100644 --- a/test/Tests/src/Data/Time/Period_Spec.enso +++ b/test/Tests/src/Data/Time/Period_Spec.enso @@ -1,5 +1,6 @@ from Standard.Base import all from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions spec = Test.group "Period" <| diff --git a/test/Tests/src/Data/Time/Spec.enso b/test/Tests/src/Data/Time/Spec.enso index 50c459eb430..9d19faa68d2 100644 --- a/test/Tests/src/Data/Time/Spec.enso +++ b/test/Tests/src/Data/Time/Spec.enso @@ -1,6 +1,7 @@ from Standard.Base import all from Standard.Test import Test_Suite +import Standard.Test.Extensions import project.Data.Time.Duration_Spec import project.Data.Time.Period_Spec diff --git a/test/Tests/src/Data/Time/Time_Of_Day_Spec.enso b/test/Tests/src/Data/Time/Time_Of_Day_Spec.enso index 2da7d15d03c..7cc176b5f17 100644 --- a/test/Tests/src/Data/Time/Time_Of_Day_Spec.enso +++ b/test/Tests/src/Data/Time/Time_Of_Day_Spec.enso @@ -1,6 +1,7 @@ from Standard.Base import all from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions polyglot java import java.time.LocalTime polyglot java import java.time.format.DateTimeFormatter diff --git a/test/Tests/src/Data/Time/Time_Zone_Spec.enso b/test/Tests/src/Data/Time/Time_Zone_Spec.enso index bdc25411807..8017c6a1f8e 100644 --- a/test/Tests/src/Data/Time/Time_Zone_Spec.enso +++ b/test/Tests/src/Data/Time/Time_Zone_Spec.enso @@ -1,6 +1,7 @@ from Standard.Base import all from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions polyglot java import java.time.ZoneId polyglot java import java.time.ZoneOffset diff --git a/test/Tests/src/Data/Vector/Slicing_Helpers_Spec.enso b/test/Tests/src/Data/Vector/Slicing_Helpers_Spec.enso index 8eeadeb48d7..fdcd7711a99 100644 --- a/test/Tests/src/Data/Vector/Slicing_Helpers_Spec.enso +++ b/test/Tests/src/Data/Vector/Slicing_Helpers_Spec.enso @@ -2,6 +2,7 @@ from Standard.Base import all import Standard.Base.Data.Index_Sub_Range from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions spec = Test.group "Vector Slicing Helpers" <| Test.specify "should be able to sort correctly merge neighboring sequences" <| diff --git a/test/Tests/src/Data/Vector_Spec.enso b/test/Tests/src/Data/Vector_Spec.enso index afd73a20344..7992afed87c 100644 --- a/test/Tests/src/Data/Vector_Spec.enso +++ b/test/Tests/src/Data/Vector_Spec.enso @@ -4,6 +4,7 @@ from Standard.Base.Data.Vector import Empty_Error import Standard.Base.Runtime.Ref.Ref from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions type T Value a b diff --git a/test/Tests/src/Main.enso b/test/Tests/src/Main.enso index 3aaaa467fe3..fb42d2a5ea2 100644 --- a/test/Tests/src/Main.enso +++ b/test/Tests/src/Main.enso @@ -1,6 +1,7 @@ from Standard.Base import all from Standard.Test import Test_Suite +import Standard.Test.Extensions import project.Semantic.Any_Spec import project.Semantic.Case_Spec diff --git a/test/Tests/src/Network/Http/Header_Spec.enso b/test/Tests/src/Network/Http/Header_Spec.enso index 5cfc61e75d6..f66b20bfd68 100644 --- a/test/Tests/src/Network/Http/Header_Spec.enso +++ b/test/Tests/src/Network/Http/Header_Spec.enso @@ -3,6 +3,7 @@ from Standard.Base import all import Standard.Base.Network.Http.Header from Standard.Test import Test +import Standard.Test.Extensions spec = Test.group "Header" <| diff --git a/test/Tests/src/Network/Http/Request_Spec.enso b/test/Tests/src/Network/Http/Request_Spec.enso index 2d632305bed..544cd27f100 100644 --- a/test/Tests/src/Network/Http/Request_Spec.enso +++ b/test/Tests/src/Network/Http/Request_Spec.enso @@ -8,6 +8,7 @@ import Standard.Base.Network.Http.Request.Body as Request_Body import Standard.Base.Network.URI from Standard.Test import Test +import Standard.Test.Extensions spec = test_uri = URI.parse "https://httpbin.org/post" diff --git a/test/Tests/src/Network/Http_Spec.enso b/test/Tests/src/Network/Http_Spec.enso index 369c36bf36d..46c1fb2253e 100644 --- a/test/Tests/src/Network/Http_Spec.enso +++ b/test/Tests/src/Network/Http_Spec.enso @@ -12,6 +12,7 @@ import Standard.Base.Network.Proxy import Standard.Base.Network.URI from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions polyglot java import java.lang.System diff --git a/test/Tests/src/Network/URI_Spec.enso b/test/Tests/src/Network/URI_Spec.enso index b00be04983a..efef232d2b4 100644 --- a/test/Tests/src/Network/URI_Spec.enso +++ b/test/Tests/src/Network/URI_Spec.enso @@ -3,6 +3,7 @@ from Standard.Base import all import Standard.Base.Network.URI from Standard.Test import Test +import Standard.Test.Extensions spec = Test.group "URI" <| diff --git a/test/Tests/src/Random_Spec.enso b/test/Tests/src/Random_Spec.enso index d8200f57973..8dd57e7299e 100644 --- a/test/Tests/src/Random_Spec.enso +++ b/test/Tests/src/Random_Spec.enso @@ -3,6 +3,7 @@ from Standard.Base import all import Standard.Base.Random from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions spec = Test.group "Random" <| Test.specify "should allow to generate random indices" <| diff --git a/test/Tests/src/Runtime/Lazy_Generator_Spec.enso b/test/Tests/src/Runtime/Lazy_Generator_Spec.enso index 3dcd8bcd6df..0c165025819 100644 --- a/test/Tests/src/Runtime/Lazy_Generator_Spec.enso +++ b/test/Tests/src/Runtime/Lazy_Generator_Spec.enso @@ -1,4 +1,5 @@ from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions type Generator Value h t diff --git a/test/Tests/src/Runtime/Managed_Resource_Spec.enso b/test/Tests/src/Runtime/Managed_Resource_Spec.enso index 95329d37fe6..c429ae43640 100644 --- a/test/Tests/src/Runtime/Managed_Resource_Spec.enso +++ b/test/Tests/src/Runtime/Managed_Resource_Spec.enso @@ -2,6 +2,7 @@ from Standard.Base import all import Standard.Base.Runtime.Managed_Resource.Managed_Resource from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions spec = Test.group "Managed_Resource" <| Test.specify "should call the destructor even if the action fails" <| diff --git a/test/Tests/src/Runtime/Stack_Traces_Spec.enso b/test/Tests/src/Runtime/Stack_Traces_Spec.enso index ba004b13910..71341466777 100644 --- a/test/Tests/src/Runtime/Stack_Traces_Spec.enso +++ b/test/Tests/src/Runtime/Stack_Traces_Spec.enso @@ -1,6 +1,7 @@ from Standard.Base import all from Standard.Test import Test +import Standard.Test.Extensions type My_Type diff --git a/test/Tests/src/Semantic/Any_Spec.enso b/test/Tests/src/Semantic/Any_Spec.enso index b5c662fe3fe..8220798e732 100644 --- a/test/Tests/src/Semantic/Any_Spec.enso +++ b/test/Tests/src/Semantic/Any_Spec.enso @@ -1,6 +1,7 @@ from Standard.Base import all from Standard.Test import Test +import Standard.Test.Extensions type My_Type Value a diff --git a/test/Tests/src/Semantic/Case_Spec.enso b/test/Tests/src/Semantic/Case_Spec.enso index a5a056a46c7..b3ebae099c8 100644 --- a/test/Tests/src/Semantic/Case_Spec.enso +++ b/test/Tests/src/Semantic/Case_Spec.enso @@ -12,6 +12,7 @@ polyglot java import java.util.List as JList from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions spec = Test.group "Pattern Matches" <| Test.specify "should be able to match on the Boolean type" <| diff --git a/test/Tests/src/Semantic/Conversion_Spec.enso b/test/Tests/src/Semantic/Conversion_Spec.enso index 9d528f934c0..66d5453184a 100644 --- a/test/Tests/src/Semantic/Conversion_Spec.enso +++ b/test/Tests/src/Semantic/Conversion_Spec.enso @@ -4,6 +4,7 @@ import project.Semantic.Conversion.Methods import project.Semantic.Conversion.Types from Standard.Test import Test +import Standard.Test.Extensions type Foo Value foo diff --git a/test/Tests/src/Semantic/Deep_Export/Spec.enso b/test/Tests/src/Semantic/Deep_Export/Spec.enso index bcc80c7d6d1..fd5709bf59c 100644 --- a/test/Tests/src/Semantic/Deep_Export/Spec.enso +++ b/test/Tests/src/Semantic/Deep_Export/Spec.enso @@ -3,6 +3,7 @@ from Standard.Base import all import project.Semantic.Deep_Export.Internal from Standard.Test import Test +import Standard.Test.Extensions spec = Test.group "Deep Exports" <| diff --git a/test/Tests/src/Semantic/Default_Args_Spec.enso b/test/Tests/src/Semantic/Default_Args_Spec.enso index 07ed3b5c7d3..df97e417dd8 100644 --- a/test/Tests/src/Semantic/Default_Args_Spec.enso +++ b/test/Tests/src/Semantic/Default_Args_Spec.enso @@ -1,6 +1,7 @@ from Standard.Base import all from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions from project.Semantic.Default_Args_Spec.Box import all diff --git a/test/Tests/src/Semantic/Error_Spec.enso b/test/Tests/src/Semantic/Error_Spec.enso index cd47bb328eb..091fc4bd7c1 100644 --- a/test/Tests/src/Semantic/Error_Spec.enso +++ b/test/Tests/src/Semantic/Error_Spec.enso @@ -7,6 +7,7 @@ polyglot java import java.lang.Long polyglot java import java.lang.NumberFormatException from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions type My_Type Value foo diff --git a/test/Tests/src/Semantic/Import_Loop/Spec.enso b/test/Tests/src/Semantic/Import_Loop/Spec.enso index 3fdf4268b7c..3649b1f7666 100644 --- a/test/Tests/src/Semantic/Import_Loop/Spec.enso +++ b/test/Tests/src/Semantic/Import_Loop/Spec.enso @@ -3,6 +3,7 @@ from Standard.Base import all import project.Semantic.Import_Loop.B from Standard.Test import Test +import Standard.Test.Extensions spec = Test.group "Looping Imports" <| Test.specify "should behave correctly and not loop the compiler" <| diff --git a/test/Tests/src/Semantic/Java_Interop_Spec.enso b/test/Tests/src/Semantic/Java_Interop_Spec.enso index dddb95e39e7..fefc0c486cd 100644 --- a/test/Tests/src/Semantic/Java_Interop_Spec.enso +++ b/test/Tests/src/Semantic/Java_Interop_Spec.enso @@ -1,5 +1,6 @@ from Standard.Base import all from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions polyglot java import java.lang.Float polyglot java import java.lang.Integer diff --git a/test/Tests/src/Semantic/Js_Interop_Spec.enso b/test/Tests/src/Semantic/Js_Interop_Spec.enso index 43adaf37a04..efcc93cc543 100644 --- a/test/Tests/src/Semantic/Js_Interop_Spec.enso +++ b/test/Tests/src/Semantic/Js_Interop_Spec.enso @@ -1,6 +1,7 @@ from Standard.Base import all from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions foreign js my_method a b = """ return a + b; diff --git a/test/Tests/src/Semantic/Meta_Location_Spec.enso b/test/Tests/src/Semantic/Meta_Location_Spec.enso index eeba5688ccd..e80f5aa6a7a 100644 --- a/test/Tests/src/Semantic/Meta_Location_Spec.enso +++ b/test/Tests/src/Semantic/Meta_Location_Spec.enso @@ -2,6 +2,7 @@ from Standard.Base import all import Standard.Base from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions type My_Type Value foo bar baz @@ -13,7 +14,7 @@ spec = Test.group "Meta-Value Inspection" <| Test.specify "should allow to get the source location of a frame" pending=location_pending <| src = Meta.get_source_location 0 - loc = "Meta_Location_Spec.enso:15:15-40" + loc = "Meta_Location_Spec.enso:16:15-40" src.take (Last loc.length) . should_equal loc Test.specify "should allow to get qualified type names of values" <| diff --git a/test/Tests/src/Semantic/Meta_Spec.enso b/test/Tests/src/Semantic/Meta_Spec.enso index 4192c250c19..d265192f214 100644 --- a/test/Tests/src/Semantic/Meta_Spec.enso +++ b/test/Tests/src/Semantic/Meta_Spec.enso @@ -10,6 +10,7 @@ polyglot java import java.util.Random polyglot java import java.util.Locale as JavaLocale from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions type My_Type Value foo bar baz diff --git a/test/Tests/src/Semantic/Names_Spec.enso b/test/Tests/src/Semantic/Names_Spec.enso index a7e6d4e3db3..f4da4604254 100644 --- a/test/Tests/src/Semantic/Names_Spec.enso +++ b/test/Tests/src/Semantic/Names_Spec.enso @@ -4,6 +4,7 @@ from project.Semantic.Names.Definitions import another_method, another_constant, import project.Semantic.Names.Definitions from Standard.Test import Test +import Standard.Test.Extensions Definitions.Foo.my_method self = case self of Definitions.Foo_Data x y z -> x * y * z diff --git a/test/Tests/src/Semantic/Python_Interop_Spec.enso b/test/Tests/src/Semantic/Python_Interop_Spec.enso index 4b4296e7aee..ad9083d6434 100644 --- a/test/Tests/src/Semantic/Python_Interop_Spec.enso +++ b/test/Tests/src/Semantic/Python_Interop_Spec.enso @@ -1,6 +1,7 @@ from Standard.Base import all from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions foreign python my_method a b = """ return a + b diff --git a/test/Tests/src/Semantic/R_Interop_Spec.enso b/test/Tests/src/Semantic/R_Interop_Spec.enso index 357c961b4fa..573597c687a 100644 --- a/test/Tests/src/Semantic/R_Interop_Spec.enso +++ b/test/Tests/src/Semantic/R_Interop_Spec.enso @@ -1,6 +1,7 @@ from Standard.Base import all from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions foreign js my_method a b = """ return a + b; diff --git a/test/Tests/src/Semantic/Runtime_Spec.enso b/test/Tests/src/Semantic/Runtime_Spec.enso index 9ac6b10cc70..113a5a0a6cc 100644 --- a/test/Tests/src/Semantic/Runtime_Spec.enso +++ b/test/Tests/src/Semantic/Runtime_Spec.enso @@ -1,6 +1,7 @@ import Standard.Base.Runtime from Standard.Test import Test +import Standard.Test.Extensions in_fn : Int -> Int in Input in_fn a = a * 2 diff --git a/test/Tests/src/Semantic/Self_Type_Spec.enso b/test/Tests/src/Semantic/Self_Type_Spec.enso index 8c3c35c405d..7b620f70900 100644 --- a/test/Tests/src/Semantic/Self_Type_Spec.enso +++ b/test/Tests/src/Semantic/Self_Type_Spec.enso @@ -1,6 +1,6 @@ from Standard.Base import all from Standard.Test import Test - +import Standard.Test.Extensions type My_Type Cons_A x diff --git a/test/Tests/src/Semantic/Warnings_Spec.enso b/test/Tests/src/Semantic/Warnings_Spec.enso index 4dd1edd0452..a476554e270 100644 --- a/test/Tests/src/Semantic/Warnings_Spec.enso +++ b/test/Tests/src/Semantic/Warnings_Spec.enso @@ -3,6 +3,7 @@ from Standard.Base import all polyglot java import java.lang.Long from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions type My_Warning Value reason diff --git a/test/Tests/src/System/Environment_Spec.enso b/test/Tests/src/System/Environment_Spec.enso index 9aa10efedb2..3152bbd5771 100644 --- a/test/Tests/src/System/Environment_Spec.enso +++ b/test/Tests/src/System/Environment_Spec.enso @@ -1,6 +1,7 @@ from Standard.Base import all from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions import Standard.Test.Test_Environment spec = Test.group "Environment" <| diff --git a/test/Tests/src/System/File_Read_Spec.enso b/test/Tests/src/System/File_Read_Spec.enso index 87caaf81556..77c50fb8e2d 100644 --- a/test/Tests/src/System/File_Read_Spec.enso +++ b/test/Tests/src/System/File_Read_Spec.enso @@ -2,6 +2,7 @@ from Standard.Base import all from Standard.Base.Error.Common import Unsupported_File_Type from Standard.Test import Test, Test_Suite, Problems +import Standard.Test.Extensions spec = sample_xxx = enso_project.data / "sample.xxx" diff --git a/test/Tests/src/System/File_Spec.enso b/test/Tests/src/System/File_Spec.enso index 5b39b73ca0f..3fc101dda40 100644 --- a/test/Tests/src/System/File_Spec.enso +++ b/test/Tests/src/System/File_Spec.enso @@ -1,6 +1,7 @@ from Standard.Base import all from Standard.Test import Test, Test_Suite, Problems +import Standard.Test.Extensions spec = sample_file = enso_project.data / "sample.txt" diff --git a/test/Tests/src/System/Process_Spec.enso b/test/Tests/src/System/Process_Spec.enso index ab496d24a9a..b2c01eed600 100644 --- a/test/Tests/src/System/Process_Spec.enso +++ b/test/Tests/src/System/Process_Spec.enso @@ -1,6 +1,7 @@ from Standard.Base import all from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions spec = Test.group "Process" <| Test.specify "should call simple command" <| diff --git a/test/Tests/src/System/Reporting_Stream_Decoder_Spec.enso b/test/Tests/src/System/Reporting_Stream_Decoder_Spec.enso index 6c5005af936..3782442256c 100644 --- a/test/Tests/src/System/Reporting_Stream_Decoder_Spec.enso +++ b/test/Tests/src/System/Reporting_Stream_Decoder_Spec.enso @@ -3,6 +3,7 @@ from Standard.Base import all polyglot java import java.nio.CharBuffer from Standard.Test import Test, Test_Suite, Problems +import Standard.Test.Extensions spec = windows_file = enso_project.data / "windows.txt" diff --git a/test/Tests/src/System/Reporting_Stream_Encoder_Spec.enso b/test/Tests/src/System/Reporting_Stream_Encoder_Spec.enso index ea93d7dbd22..76c2863e3c5 100644 --- a/test/Tests/src/System/Reporting_Stream_Encoder_Spec.enso +++ b/test/Tests/src/System/Reporting_Stream_Encoder_Spec.enso @@ -4,6 +4,7 @@ polyglot java import org.enso.base.Encoding_Utils polyglot java import java.nio.CharBuffer from Standard.Test import Test, Test_Suite, Problems +import Standard.Test.Extensions spec = Test.group "ReportingStreamEncoder" <| diff --git a/test/Tests/src/System/System_Spec.enso b/test/Tests/src/System/System_Spec.enso index cd58a2ae7bb..3b5165ce41f 100644 --- a/test/Tests/src/System/System_Spec.enso +++ b/test/Tests/src/System/System_Spec.enso @@ -1,6 +1,7 @@ from Standard.Base import all from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions spec = Test.group "System" <| Test.specify "should provide nanosecond timer" <| diff --git a/test/Visualization_Tests/src/Geo_Map_Spec.enso b/test/Visualization_Tests/src/Geo_Map_Spec.enso index 717962af1f8..1b76efea05c 100644 --- a/test/Visualization_Tests/src/Geo_Map_Spec.enso +++ b/test/Visualization_Tests/src/Geo_Map_Spec.enso @@ -4,6 +4,7 @@ from Standard.Table import Table import Standard.Visualization.Geo_Map from Standard.Test import Test +import Standard.Test.Extensions import project.Helpers diff --git a/test/Visualization_Tests/src/Helpers.enso b/test/Visualization_Tests/src/Helpers.enso index 3572e6eb736..c9c5e5aca7b 100644 --- a/test/Visualization_Tests/src/Helpers.enso +++ b/test/Visualization_Tests/src/Helpers.enso @@ -3,6 +3,7 @@ from Standard.Base import all from Standard.Table import Column from Standard.Test import Test +import Standard.Test.Extensions import Standard.Test.Test_Result.Test_Result Column.expect : Text -> Vector -> Test_Result diff --git a/test/Visualization_Tests/src/Helpers_Spec.enso b/test/Visualization_Tests/src/Helpers_Spec.enso index da180518b34..dc17a3dc64e 100644 --- a/test/Visualization_Tests/src/Helpers_Spec.enso +++ b/test/Visualization_Tests/src/Helpers_Spec.enso @@ -5,6 +5,7 @@ from Standard.Table import Table import Standard.Visualization.Helpers from Standard.Test import Test +import Standard.Test.Extensions import project.Helpers diff --git a/test/Visualization_Tests/src/Histogram_Spec.enso b/test/Visualization_Tests/src/Histogram_Spec.enso index 04094e011dd..db76b6f0cf4 100644 --- a/test/Visualization_Tests/src/Histogram_Spec.enso +++ b/test/Visualization_Tests/src/Histogram_Spec.enso @@ -5,6 +5,7 @@ from Standard.Table import Table, Column import Standard.Visualization.Histogram from Standard.Test import Test +import Standard.Test.Extensions import project diff --git a/test/Visualization_Tests/src/Id_Spec.enso b/test/Visualization_Tests/src/Id_Spec.enso index 917f78e54bf..a18973b6d92 100644 --- a/test/Visualization_Tests/src/Id_Spec.enso +++ b/test/Visualization_Tests/src/Id_Spec.enso @@ -4,6 +4,7 @@ import Standard.Base import Standard.Visualization from Standard.Test import Test +import Standard.Test.Extensions type My_Type Value my_field diff --git a/test/Visualization_Tests/src/SQL_Spec.enso b/test/Visualization_Tests/src/SQL_Spec.enso index 1b3d47e4cc8..e95ae27d7a1 100644 --- a/test/Visualization_Tests/src/SQL_Spec.enso +++ b/test/Visualization_Tests/src/SQL_Spec.enso @@ -5,6 +5,7 @@ from Standard.Database import Database, SQLite, SQL_Query import Standard.Visualization.SQL.Visualization from Standard.Test import Test +import Standard.Test.Extensions visualization_spec connection = connection.execute_update 'CREATE TABLE "T" ("A" VARCHAR, "B" INTEGER, "C" INTEGER)' diff --git a/test/Visualization_Tests/src/Scatter_Plot_Spec.enso b/test/Visualization_Tests/src/Scatter_Plot_Spec.enso index 0bb95d6adf3..2fc70967112 100644 --- a/test/Visualization_Tests/src/Scatter_Plot_Spec.enso +++ b/test/Visualization_Tests/src/Scatter_Plot_Spec.enso @@ -5,6 +5,7 @@ from Standard.Table import Table, Column import Standard.Visualization.Scatter_Plot from Standard.Test import Test, Test_Suite +import Standard.Test.Extensions import project diff --git a/test/Visualization_Tests/src/Table_Spec.enso b/test/Visualization_Tests/src/Table_Spec.enso index e13d902cb8d..0014ddd6e7a 100644 --- a/test/Visualization_Tests/src/Table_Spec.enso +++ b/test/Visualization_Tests/src/Table_Spec.enso @@ -9,6 +9,7 @@ import Standard.Database.Data.Table.Table as Database_Table import Standard.Visualization.Table.Visualization from Standard.Test import Test +import Standard.Test.Extensions polyglot java import java.util.UUID diff --git a/test/Visualization_Tests/src/Visualization_Spec.enso b/test/Visualization_Tests/src/Visualization_Spec.enso index 9f423abd723..8fe3a3dbcef 100644 --- a/test/Visualization_Tests/src/Visualization_Spec.enso +++ b/test/Visualization_Tests/src/Visualization_Spec.enso @@ -5,6 +5,7 @@ import Standard.Examples import Standard.Visualization from Standard.Test import Test +import Standard.Test.Extensions import Standard.Visualization.File_Upload.File_Being_Uploaded