Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmarcal-faire committed Nov 5, 2024
1 parent 304adcb commit f5afbc4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
5 changes: 1 addition & 4 deletions swiftpkg/internal/modulemap_parser/collect_module.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,7 @@ def _process_module_tokens(parsed_tokens, prefix_tokens, is_submodule):
not tokens.is_a(module_declaration_identifier_token, tts.operator, operators.asterisk) and \
not tokens.is_a(module_declaration_identifier_token, tts.string_literal):
return None, errors.new(
"Expected module identifier, asterisk or string_literal, but was {} with value {}.".format(
module_declaration_identifier_token.type,
module_declaration_identifier_token.value,
),
"Expected module identifier, asterisk or string_literal, but was {}.".format(module_declaration_identifier_token.type)
)

# Collect the attributes and module members
Expand Down
6 changes: 2 additions & 4 deletions swiftpkg/tests/modulemap_parser/collect_module_tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,7 @@ def _collect_module_test(ctx):
env,
"module with string literal module id",
text = """
module "MyModule" {
umbrella header "MyModule/MyModule.h"
}
module "MyModule" {}
""",
expected = [
declarations.module(
Expand Down Expand Up @@ -178,7 +176,7 @@ def _collect_module_test(ctx):
text = """
module {}
""",
expected_err = "Expected module identifier or asterisk, but was curly_bracket_open.",
expected_err = "Expected module identifier, asterisk or string_literal, but was curly_bracket_open.",
)

do_failing_parse_test(
Expand Down

0 comments on commit f5afbc4

Please sign in to comment.