Skip to content

Commit

Permalink
Execute all Text. tests in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
JaroslavTulach committed May 19, 2024
1 parent e9a55f0 commit 5cc50de
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
7 changes: 7 additions & 0 deletions build/build/src/engine/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -649,5 +649,12 @@ pub async fn runner_sanity_test(
output.contains(factorial_expected_output),
"Native runner output does not contain expected result '{factorial_expected_output}'. Output:\n{output}",
);
let test_base = Command::new(&repo_root.runner)
.args(["--run", repo_root.test.join("Base_Tests").as_str(), "Test\\."])
.set_env_opt(ENSO_JAVA, enso_java)?
.set_env(ENSO_DATA_DIRECTORY, engine_package)?
.run_stdout()
.await?;
ensure!(test_base.contains("0 tests failed."), "All tests shall succeed. Output:\n{test_base}",);
Ok(())
}
8 changes: 4 additions & 4 deletions test/Base_Tests/src/Data/Text_Spec.enso
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ add_specs suite_builder =
accent_1 = '\u00E9'
accent_2 = '\u0065\u{301}'

suite_builder.group "Text" group_builder->
suite_builder.group "Text.general" group_builder->
kshi = '\u0915\u094D\u0937\u093F'
facepalm = '\u{1F926}\u{1F3FC}\u200D\u2642\uFE0F'
utf_8_whitespace = 'foo\n bar baz \u202F quux'
Expand Down Expand Up @@ -1354,7 +1354,7 @@ add_specs suite_builder =
txt.find "a[bc]" . text 0 . should_equal "ab"
txt.find_all "a[bc]" . map (match-> match.text 0) . should_equal ["ab", "ac"]

suite_builder.group "Regex: find and find_all" group_builder->
suite_builder.group "Text.Regex: find and find_all" group_builder->
group_builder.specify "should be possible on text" <|
"My Text: Goes Here".find "^My Text: (.+)$" . text 0 . should_equal "My Text: Goes Here"

Expand Down Expand Up @@ -1476,7 +1476,7 @@ add_specs suite_builder =
locale = Locale.new "en" "GB" "UTF-8"
'a'.match 'a' case_sensitivity=(Case_Sensitivity.Insensitive locale) . should_fail_with Illegal_Argument

suite_builder.group "Regex splitting" group_builder->
suite_builder.group "Text.Regex splitting" group_builder->
group_builder.specify "should be possible on text" <|
splits = "abcde".split "[bd]" use_regex=True
splits.length . should_equal 3
Expand All @@ -1498,7 +1498,7 @@ add_specs suite_builder =
splits.at 1 . should_equal "a"
splits.at 2 . should_equal "a"

suite_builder.group "Regex tokenizing" group_builder->
suite_builder.group "Text.Regex tokenizing" group_builder->
group_builder.specify "can tokenize with simple regexes without capturing groups"
"1-800-regex-yes" . tokenize "[a-z]+" . should_equal ["regex", "yes"]
"1-800-REGEX-YES" . tokenize "[a-z]+" case_sensitivity=Case_Sensitivity.Insensitive . should_equal ["REGEX", "YES"]
Expand Down

0 comments on commit 5cc50de

Please sign in to comment.