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

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

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

MichaelChirico
Copy link
Owner

Closes #256

@MichaelChirico
Copy link
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
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
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
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
Collaborator

hadley commented Nov 9, 2021

The joys of snapshot testing!

@MichaelChirico
Copy link
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 <[email protected]>
@MichaelChirico
Copy link
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