Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pending_wasm32 #14086

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/wasm32.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
rm wasm32-wasi-libs.tar.gz

- name: Build spec/wasm32_std_spec.cr
run: bin/crystal build spec/wasm32_std_spec.cr -o wasm32_std_spec.wasm --target wasm32-wasi -Duse_pcre -Dwithout_openssl
run: bin/crystal build spec/wasm32_std_spec.cr -o wasm32_std_spec.wasm --target wasm32-wasi -Dwithout_iconv -Dwithout_openssl
env:
CRYSTAL_LIBRARY_PATH: ${{ github.workspace }}/wasm32-wasi-libs

Expand Down
1 change: 1 addition & 0 deletions spec/spec_helper.cr
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ require "compiler/requires"
require "./support/syntax"
require "./support/tempfile"
require "./support/win32"
require "./support/wasm32"

class Crystal::Program
setter temp_var_counter
Expand Down
4 changes: 2 additions & 2 deletions spec/std/html_spec.cr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require "spec"
require "./spec_helper"
require "html"

describe "HTML" do
Expand All @@ -12,7 +12,7 @@ describe "HTML" do
end
end

describe ".unescape" do
pending_wasm32 describe: ".unescape" do
it "identity" do
HTML.unescape("safe_string").should be("safe_string")
end
Expand Down
2 changes: 1 addition & 1 deletion spec/std/path_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ describe Path do
assert_paths_raw("foo..txt/", "foo.", &.stem)
end

describe ".home" do
pending_wasm32 describe: ".home" do
it "uses home from environment variable if set" do
with_env({HOME_ENV_KEY => "foo/bar"}) do
Path.home.should eq(Path.new("foo/bar"))
Expand Down
2 changes: 1 addition & 1 deletion spec/std/regex_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ describe "Regex" do
end
end

it "doesn't crash with a large single line string" do
pending_wasm32 "doesn't crash with a large single line string" do
str = File.read(datapath("large_single_line_string.txt"))

{% if Regex::Engine.resolve.name == "Regex::PCRE" %}
Expand Down
1 change: 1 addition & 0 deletions spec/std/spec_helper.cr
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ require "spec"
require "../support/tempfile"
require "../support/fibers"
require "../support/win32"
require "../support/wasm32"

def datapath(*components)
File.join("spec", "std", "data", *components)
Expand Down
12 changes: 5 additions & 7 deletions spec/std/string_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -2687,14 +2687,12 @@ describe "String" do
end
end

{% unless flag?(:wasm32) %}
it "allocates buffer of correct size (#3332)" do
String.new(255_u8) do |buffer|
LibGC.size(buffer).should be > 255
{255, 0}
end
pending_wasm32 "allocates buffer of correct size (#3332)" do
String.new(255_u8) do |buffer|
LibGC.size(buffer).should be > 255
{255, 0}
end
{% end %}
end

it "raises if returned bytesize is greater than capacity" do
expect_raises ArgumentError, "Bytesize out of capacity bounds" do
Expand Down
19 changes: 19 additions & 0 deletions spec/support/wasm32.cr
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
require "spec"

{% if flag?(:wasm32) %}
def pending_wasm32(description = "assert", file = __FILE__, line = __LINE__, end_line = __END_LINE__, &block)
pending("#{description} [wasm32]", file, line, end_line)
end

def pending_wasm32(*, describe, file = __FILE__, line = __LINE__, end_line = __END_LINE__, &block)
pending_wasm32(describe, file, line, end_line) { }
end
{% else %}
def pending_wasm32(description = "assert", file = __FILE__, line = __LINE__, end_line = __END_LINE__, &block)
it(description, file, line, end_line, &block)
end

def pending_wasm32(*, describe, file = __FILE__, line = __LINE__, end_line = __END_LINE__, &block)
describe(describe, file, line, end_line, &block)
end
{% end %}
6 changes: 3 additions & 3 deletions spec/wasm32_std_spec.cr

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.