i18n4go icon indicating copy to clipboard operation
i18n4go copied to clipboard

Test failure for rewrite-package command

Open Aerex opened this issue 2 years ago • 2 comments

There is an issue with replacing the FULL_IMPORT_PATH when simulating the rewrite-package command. This is leading to the following errors:

Total files parsed: 1
Total rewritten strings: 1
Total time: 422.804µs
• Failure [0.011 seconds]
rewrite-package [...] --init-code-snippet-filename some-file
...i18n4go/integration/rewrite_package/init_code_snippet_filename_test.go:14
  invokes rewrite-package command and uses the specified --init-code-snippet-filename
  ...i18n4go/integration/rewrite_package/init_code_snippet_filename_test.go:83
    rewrites the source go file wrapping strings with T() and generates a i18n_init.go using teamplate file [It]
...integration/rewrite_package/init_code_snippet_filename_test.go:108

    Expected
        <string>: package input_files

        import (
                "fmt"
                "path/filepath"

                "github.com/maximilien/i18n4go/i18n"
                goi18n "github.com/nicksnyder/go-i18n/i18n"
        )

        var T goi18n.TranslateFunc

        func init() {
                fmt.Println("DEBUG: this is a test i18n_init.go file")
                T = i18n.Init(filepath.Join(""), i18n.GetResourcesPath())
        }

    to equal
        <string>: package input_files

        import (
                "fmt"
                "path/filepath"

                "github.com/maximilien/i18n4go/i18n"
                goi18n "github.com/nicksnyder/go-i18n/i18n"
        )

        var T goi18n.TranslateFunc

        func init() {
                fmt.Println("DEBUG: this is a test i18n_init.go file")
                T = i18n.Init(filepath.Join("test_fixtures", "rewrite_package", "init_code_snippet_filename", "input_files"), i18n.GetResourcesPath())
        }

Aerex avatar Jun 20 '22 21:06 Aerex

Thanks for your contribution. Please contact me @maximilien to ensure follow-up.

github-actions[bot] avatar Jun 20 '22 21:06 github-actions[bot]

Resolved in PR #60

Aerex avatar Oct 03 '22 22:10 Aerex