Skip to content
Open
20 changes: 0 additions & 20 deletions distribution/lib/Standard/Test/0.0.0-dev/docs/api/Faker.md

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
## Enso Signatures 1.0
## module Standard.Test.Suite
- type Suite
- Impl groups:(Standard.Base.Data.Vector.Vector Standard.Test.Group.Group)
- group_names self -> Standard.Base.Any.Any
- print_all self -> Standard.Base.Any.Any
- run_with_filter self filter:(Standard.Base.Data.Text.Text|Standard.Base.Nothing.Nothing)= should_exit:Standard.Base.Data.Boolean.Boolean= -> (Standard.Base.Data.Boolean.Boolean|Standard.Base.Nothing.Nothing)
- type Suite_Builder
- Impl builder:Standard.Base.Any.Any
- group self name:Standard.Base.Data.Text.Text fn:Standard.Base.Any.Any pending:(Standard.Base.Data.Text.Text|Standard.Base.Nothing.Nothing)= -> Standard.Base.Any.Any
- group self name:Standard.Base.Data.Text.Text fn:Standard.Base.Any.Any ~pending:(Standard.Base.Data.Text.Text|Standard.Base.Nothing.Nothing)= -> Standard.Base.Any.Any
- name_matches name:Standard.Base.Data.Text.Text filter:(Standard.Base.Data.Text.Text|Standard.Base.Nothing.Nothing) -> Standard.Base.Data.Boolean.Boolean
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
## Enso Signatures 1.0
## module Standard.Test.Test_Result
- type Test_Result
- Impl group_name:Standard.Base.Data.Text.Text spec_name:Standard.Base.Data.Text.Text spec_result:Standard.Test.Spec_Result.Spec_Result time_taken:Standard.Base.Data.Time.Duration.Duration
- is_fail self -> Standard.Base.Any.Any
- is_pending self -> Standard.Base.Any.Any
- is_success self -> Standard.Base.Any.Any
Expand Down
8 changes: 2 additions & 6 deletions distribution/lib/Standard/Test/0.0.0-dev/src/Group.enso
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,8 @@ type Group_Builder
- `code`: A thunk that takes no arguments.
- `pending`: Contains a reason for why the test should be ignored. If
Nothing, the test is not ignored.
specify self (name : Text) (~code : Any) (pending : (Text | Nothing) = Nothing) =
case pending of
Nothing ->
self.builder.append <| Spec.Impl name (_ -> code) pending
pend_reason : Text ->
self.builder.append <| Spec.Impl name (_ -> Nothing) pend_reason
specify self (name : Text) (~code : Any) (~pending : (Text | Nothing) = Nothing) =
self.builder.append <| Spec.Impl name (_ -> code) pending


## Provide a teardown of a group - a method that will be called once all the
Expand Down
3 changes: 0 additions & 3 deletions distribution/lib/Standard/Test/0.0.0-dev/src/Main.enso
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import project.Bench.Bench
import project.Bench.Phase_Conf
import project.Faker.Faker
import project.Problems
import project.Suite.Suite
import project.Test.Test
Expand All @@ -25,8 +24,6 @@ export project.Extensions.should_only_contain_elements_in
export project.Extensions.should_start_with
export project.Extensions.should_succeed

export project.Faker.Faker

export project.Frame_Hider

export project.Problems
Expand Down
2 changes: 1 addition & 1 deletion distribution/lib/Standard/Test/0.0.0-dev/src/Spec.enso
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ private
from Standard.Base import all

type Spec
Impl (name : Text) (code : Any -> Any) (pending : (Nothing | Text))
private Impl (name : Text) (code : Any -> Any) (~pending : (Nothing | Text))

to_text self =
pend = if self.pending.is_nothing then "" else
Expand Down
17 changes: 6 additions & 11 deletions distribution/lib/Standard/Test/0.0.0-dev/src/Suite.enso
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type Suite_Builder

## Arguments
- `builder`: Vector builder that holds all the groups.
Impl builder
private Impl builder

## Add a group to the suite builder.

Expand All @@ -31,16 +31,11 @@ type Suite_Builder
- `pending`: Contains a reason for why the test group should be ignored.
If Nothing, the test is not ignored.
group : Text -> (Group_Builder -> Any) -> (Text | Nothing) -> Nothing
group self (name:Text) (fn : (Group_Builder -> Any)) (pending : (Text | Nothing) = Nothing) =
group self (name:Text) (fn : (Group_Builder -> Any)) (~pending : (Text | Nothing) = Nothing) =
group_builder = Group_Builder.Impl name
case pending of
Nothing ->
fn group_builder
group = Group.Impl name group_builder.teardown_ref.get group_builder.builder.to_vector pending
self.builder.append group
pend_reason : Text ->
group = Group.Impl name group_builder.teardown_ref.get [] pend_reason
self.builder.append group
fn group_builder
group = Group.Impl name group_builder.teardown_ref.get group_builder.builder.to_vector (pending...)
self.builder.append group


## A testing suite that holds all the groups with test specs.
Expand All @@ -50,7 +45,7 @@ type Suite
## ---
private: true
---
Impl (groups : Vector Group)
private Impl (groups : Vector Group)

## Run only tests that match the provided filter.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type Test_Result
## ---
private: true
---
Impl (group_name : Text) (spec_name : Text) (spec_result : Spec_Result) (time_taken : Duration)
private Impl (group_name : Text) (spec_name : Text) (spec_result : Spec_Result) (time_taken : Duration)

## ---
private: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public Object execute(VirtualFrame frame) {
var state = EnsoContext.get(this).currentState();
var args = Function.ArgumentsHelper.getPositionalArguments(frame.getArguments());
assert args.length == 1;
assert args[0] instanceof Function fn && fn.isThunk();
assert args[0] instanceof Function fn && fn.isFullyApplied();
var raw = evalThunk.executeThunk(frame, args[0], state, BaseNode.TailStatus.NOT_TAIL);
var result = check.handleCheckOrConversion(frame, raw);
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ final Object findDirectMatch(VirtualFrame frame, Object v) {

@ExplodeLoop
private final Object directMatchImpl(Object v) {
if (v instanceof Function fn && fn.isThunk()) {
if (v instanceof Function fn && fn.isFullyApplied()) {
return fn;
}
assert EnsoContext.get(this).getBuiltins().any() != expectedType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public final Object handleCheckOrConversion(VirtualFrame frame, Object value) {

private final Object handleCheckOrConversionImpl(VirtualFrame frame, Object value) {
var direct = check.findDirectMatch(frame, value);
if (direct instanceof Function fn && fn.isThunk()) {
if (direct instanceof Function fn && fn.isFullyApplied()) {
if (lazyCheck == null) {
CompilerDirectives.transferToInterpreter();
var enso = EnsoLanguage.get(this);
Expand Down
16 changes: 9 additions & 7 deletions test/Base_Tests/src/Network/Http/Http_Auto_Parse_Spec.enso
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ add_specs suite_builder =
content_utf = '["x", "Hello! 😊👍 ąę"]'
content_windows_1250 = '["y", "Hello! ąę"]'

url_utf8 = (URI.from base_url_with_slash / "test_headers")
. add_query_argument "Content-Type" "text/plain; charset=utf-8"
. add_query_argument "base64_response_data" (Base_64.encode_text content_utf)

url_windows_1250 = (URI.from base_url_with_slash / "test_headers")
. add_query_argument "Content-Type" "text/plain; charset=windows-1250"
. add_query_argument "base64_response_data" (Base_64.encode_text content_windows_1250 Encoding.windows_1250)
url_utf8 =
(URI.from base_url_with_slash / "test_headers")
. add_query_argument "Content-Type" "text/plain; charset=utf-8"
. add_query_argument "base64_response_data" (Base_64.encode_text content_utf)

url_windows_1250 =
(URI.from base_url_with_slash / "test_headers")
. add_query_argument "Content-Type" "text/plain; charset=windows-1250"
. add_query_argument "base64_response_data" (Base_64.encode_text content_windows_1250 Encoding.windows_1250)

group_builder.specify "should detect the encoding from Content-Type in fetch" <| Test.with_retries <|
url_utf8.fetch . should_equal content_utf
Expand Down
21 changes: 14 additions & 7 deletions test/Base_Tests/src/Network/Http_Spec.enso
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,10 @@ add_specs suite_builder =

url_get = base_url_with_slash.if_not_nothing <| base_url_with_slash + "get"
suite_builder.group "fetch" pending=pending_has_url group_builder->
url_head = base_url_with_slash + "head"
url_options = base_url_with_slash + "options"
url_head =
base_url_with_slash + "head"
url_options =
base_url_with_slash + "options"

group_builder.specify "Can perform a GET with a JSON response" <| Test.with_retries <|
response = Data.fetch url_get
Expand Down Expand Up @@ -240,10 +242,14 @@ add_specs suite_builder =
err.catch.message.should_equal "Data.read cannot be used with a Vector. Please use Data.read_many."

suite_builder.group "post" pending=pending_has_url group_builder->
url_post = base_url_with_slash + "post"
url_put = base_url_with_slash + "put"
url_patch = base_url_with_slash + "patch"
url_delete = base_url_with_slash + "delete"
url_post =
base_url_with_slash + "post"
url_put =
base_url_with_slash + "put"
url_patch =
base_url_with_slash + "patch"
url_delete =
base_url_with_slash + "delete"

group_builder.specify "Can perform a Request_Body.Text POST" <| Test.with_retries <|
response = Data.post url_post (Request_Body.Text "hello world")
Expand Down Expand Up @@ -457,7 +463,8 @@ add_specs suite_builder =
Data.post url_post (Request_Body.Binary test_file) . should_fail_with Request_Error

suite_builder.group "Headers" pending=pending_has_url group_builder->
url_post = base_url_with_slash + "post"
url_post =
base_url_with_slash + "post"

group_builder.specify "Content-type in the body is respected" <| Test.with_retries <|
response = Data.post url_post (Request_Body.Text '{"a": "asdf", "b": 123}' content_type="application/json")
Expand Down
2 changes: 1 addition & 1 deletion test/Base_Tests/src/Semantic/Error_Spec.enso
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Standard.Base.Errors.Empty_Error.Empty_Error
import Standard.Base.Runtime.Ref.Ref
from Standard.Base.Panic import Wrapped_Dataflow_Error

import Standard.Test.Should_Reach.Should_Reach
import project.Semantic.Should_Reach.Should_Reach
from Standard.Test import all

polyglot java import java.lang.Long
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
private

from Standard.Base import all
import Standard.Base.Runtime.Ref.Ref

import project.Frame_Hider
import project.Spec_Result.Spec_Result
from project import Test
from project.Extensions import all
import Standard.Test.Frame_Hider
import Standard.Test.Spec_Result.Spec_Result
from Standard.Test import Test
from Standard.Test.Extensions import all

## Test class for checking if a certain point in the code has been reached.
type Should_Reach
Expand Down
4 changes: 2 additions & 2 deletions test/Benchmarks/src/Column_Numeric.enso
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from Standard.Base import all

from Standard.Table import Column
from Standard.Test import Bench, Faker

from Standard.Test import Bench
import project.Faker.Faker

options = Bench.options

Expand Down
3 changes: 2 additions & 1 deletion test/Benchmarks/src/Decimal_Benchmark.enso
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from Standard.Base import all

from Standard.Test import Bench, Faker
from Standard.Test import Bench
import project.Faker.Faker


options = Bench.options . set_warmup (Bench.phase_conf 1 3) . set_measure (Bench.phase_conf 1 3)
Expand Down
3 changes: 2 additions & 1 deletion test/Benchmarks/src/Natural_Order_Sort.enso
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from Standard.Base import all

from Standard.Test import Bench, Faker
from Standard.Test import Bench
import project.Faker.Faker

options = Bench.options . set_warmup (Bench.phase_conf 1 8) . set_measure (Bench.phase_conf 1 4)

Expand Down
3 changes: 2 additions & 1 deletion test/Benchmarks/src/Number_Parse.enso
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from Standard.Base import all

from Standard.Test import Bench, Faker
from Standard.Test import Bench
import project.Faker.Faker


options = Bench.options . set_warmup (Bench.phase_conf 1 5) . set_measure (Bench.phase_conf 1 3)
Expand Down
3 changes: 2 additions & 1 deletion test/Benchmarks/src/Numeric.enso
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from Standard.Base import all
import Standard.Base.Runtime.Ref.Ref

from Standard.Test import Bench, Faker
from Standard.Test import Bench
from Standard.Base.Runtime import assert
import project.Faker.Faker


options = Bench.options . set_warmup (Bench.phase_conf 1 3) . set_measure (Bench.phase_conf 1 3)
Expand Down
3 changes: 2 additions & 1 deletion test/Benchmarks/src/Statistics/Count_Min_Max.enso
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ from Standard.Base import Integer, Vector
from Standard.Base.Data.Statistics import all
import Standard.Base.Data.Range

from Standard.Test import Bench, Faker
from Standard.Test import Bench
import project.Faker.Faker


create_vector : Integer -> Integer -> Vector
Expand Down
3 changes: 2 additions & 1 deletion test/Benchmarks/src/Table/Aggregate.enso
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ from Standard.Base import all

from Standard.Table import Table, Aggregate_Column

from Standard.Test import Bench, Faker
from Standard.Test import Bench
import project.Faker.Faker


create_table : Integer -> Integer -> Table
Expand Down
3 changes: 2 additions & 1 deletion test/Benchmarks/src/Table/Cross_Tab.enso
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ from Standard.Base import all

from Standard.Table import Table, Aggregate_Column

from Standard.Test import Bench, Faker
from Standard.Test import Bench
import project.Faker.Faker


options = Bench.options . set_warmup (Bench.phase_conf 1 2) . set_measure (Bench.phase_conf 1 2)
Expand Down
3 changes: 2 additions & 1 deletion test/Benchmarks/src/Text/Compare.enso
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from Standard.Base import all

from Standard.Test import Bench, Faker
from Standard.Test import Bench
import project.Faker.Faker


compare_all_adjacent text_vector =
Expand Down
3 changes: 2 additions & 1 deletion test/Benchmarks/src/Text/Contains.enso
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from Standard.Base import all

from Standard.Test import Bench, Faker
from Standard.Test import Bench
import project.Faker.Faker


options = Bench.options . set_warmup (Bench.phase_conf 2 3) . set_measure (Bench.phase_conf 2 3)
Expand Down
3 changes: 2 additions & 1 deletion test/Benchmarks/src/Text/Pretty.enso
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from Standard.Base import all

from Standard.Test import Bench, Faker
from Standard.Test import Bench
import project.Faker.Faker


cycle_character_template num character_templates =
Expand Down
3 changes: 2 additions & 1 deletion test/Benchmarks/src/Text/Regex_Bench.enso
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ from Standard.Base.Runtime import assert

import Standard.Base.Data.Text.Regex.Internal.Replacer.Replacer

from Standard.Test import Bench, Faker
from Standard.Test import Bench
import project.Faker.Faker


type Data
Expand Down
3 changes: 2 additions & 1 deletion test/Benchmarks/src/Text/Reverse.enso
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from Standard.Base import all

from Standard.Test import Bench, Faker
from Standard.Test import Bench
import project.Faker.Faker


type Data
Expand Down
Loading
Loading