Skip to content

WIP: convert test-translate-package to snapshots#257

Open
MichaelChirico wants to merge 22 commits intomasterfrom
snapshots
Open

WIP: convert test-translate-package to snapshots#257
MichaelChirico wants to merge 22 commits intomasterfrom
snapshots

Conversation

@MichaelChirico
Copy link
Copy Markdown
Owner

Closes #256

@MichaelChirico
Copy link
Copy Markdown
Owner Author

I think this is a dead end pending r-lib/testthat#1484...

expect_match(prompts, "a similar message was previously translated as", all=FALSE)
})
with_restoration_test_that("translate_package works on a simple package w/o translating", "r_msg", {
mockery::stub(translate_package, "get_atime", "0000-01-01 00:00:00")
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hadley I couldn't seem to make mockery::stub work inside with_restoration_test_that, are you familiar enough with whether that's possible?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sorry 😞

@MichaelChirico
Copy link
Copy Markdown
Owner Author

Current failure:

- "    ..... done."
+ "    .... done."

It appears the gettext tool is producing a differing number of . on the local vs CI system tools 🤦

@hadley
Copy link
Copy Markdown
Collaborator

hadley commented Nov 9, 2021

The joys of snapshot testing!

@MichaelChirico
Copy link
Copy Markdown
Owner Author

quite a pain but the test file will be sooo much cleaner if it can work, so not giving up just yet

MichaelChirico added a commit that referenced this pull request Nov 11, 2021
…235)

* Implement tr_add() for adding new translations

* Add or update as necessary

* Only add previous for tr_add()

* Fix typo

* Split tr_add() into po_create() and po_update()

* lang->languages

* lang->languages

* Mark .pot file as UTF-8

* Split po_create() and po_update() into pieces

And fundamentally change approach

* Fix broken tests

* Add test for po_create()

Bringing in system2() code from #257

* WS

* Extract out local_test_package() helper

* Extract & test po_language_files()

* Add tests for create and update

And fix the bugs thus revealed

* Add missing line

* might as well use fifelse

* Add links to solaris docs

* Revert unintentional change

* Move local_test_package() to better home

* Revert CHARSET -> UTF-8 change

* More docs about updating

* Standardise number of dots

* Improve docs

* Tweak messaging

* Revert accidental doc changes

* add TODO

* another TODO

* typo

* clarify fuzzy description

* comment need for standardise_dots & americanize 🇺🇸

Co-authored-by: Michael Chirico <michaelchirico4@gmail.com>
@MichaelChirico
Copy link
Copy Markdown
Owner Author

Lots of fun with encoding on Windows :)

And the en@quot thing is rearing its ugly head again :\

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use snapshot tests

2 participants