Skip to content

Commit

Permalink
Adjusted test cases due to change in directive parsing.
Browse files Browse the repository at this point in the history
We changed the structure of the regex to be a little less flexible, so
we adjust our test examples to match the updated format.
  • Loading branch information
dyoo committed Nov 10, 2023
1 parent a502e65 commit 87e3560
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions i18n-helpers/src/bin/mdbook-xgettext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,10 @@ mod tests {
(
"src/foo.md",
"
<!-- mdbook-xgettext-comment: This is a header. -->
<!-- mdbook-xgettext:comment: This is a header. -->
# How to Foo
<!-- mdbook-xgettext-comment: I am a comment. -->
<!-- mdbook-xgettext:comment: I am a comment. -->
The first paragraph about Foo.
Still the first paragraph.
",
Expand Down
10 changes: 5 additions & 5 deletions i18n-helpers/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1585,7 +1585,7 @@ def g(x):
assert_eq!(
extract_messages(
"
<!-- mdbook-xgettext-comment: first comment! -->
<!-- mdbook-xgettext:comment: first comment! -->
Hello world!
"
)
Expand All @@ -1606,8 +1606,8 @@ Hello world!
assert_eq!(
extract_messages(
"
<!-- mdbook-xgettext-comment: this is a test -->
<!-- mdbook-xgettext-comment: of a comment that spans. -->
<!-- mdbook-xgettext:comment: this is a test -->
<!-- mdbook-xgettext:comment: of a comment that spans. -->
Greetings!
"
)
Expand All @@ -1630,11 +1630,11 @@ Greetings!
"
before-no-comment
<!-- mdbook-xgettext-comment: another -->
<!-- mdbook-xgettext:comment: another -->
Hello again, this is some text
with a comment on it.
<!-- mdbook-xgettext-comment: one more comment. -->
<!-- mdbook-xgettext:comment: one more comment. -->
after
after-no-comment
Expand Down

0 comments on commit 87e3560

Please sign in to comment.