Testing | holidays-go | Spatie       

 SPATIE  

holidays-go
===========

spatie.be/open-source

  [Docs](https://spatie.be/docs)  [Holidays-go](https://spatie.be/docs/holidays-go/v1)  Testing

 Version   v1      

 Other versions for crawler [v1](https://spatie.be/docs/holidays-go/v1) 

  Testing    
- [ Introduction ](https://spatie.be/docs/holidays-go/v1/introduction)
- [ Installation and setup ](https://spatie.be/docs/holidays-go/v1/installation-and-setup)
- [ Usage ](https://spatie.be/docs/holidays-go/v1/usage)
- [ Adding a new country ](https://spatie.be/docs/holidays-go/v1/adding-a-country)
- [ Testing ](https://spatie.be/docs/holidays-go/v1/testing)
- [ Releasing ](https://spatie.be/docs/holidays-go/v1/releasing)
- [ Changelog ](https://spatie.be/docs/holidays-go/v1/changelog)
- [ Support us ](https://spatie.be/docs/holidays-go/v1/support-us)

 Testing
=======

Run `go test -race ./...` to execute the tests and examples. Run `go vet ./...` for static checks and `go mod tidy -diff` to check dependency metadata. Format code with `gofmt -w .`.

The public API tests cover queries, regions, translations, JSON, errors, date boundaries, concurrent reads and real provider replacement. `Example` is compiled and executed by `go test`.

`TestPHPParity` compares 1,237 country, region and locale configurations across 1901–2100, totaling 247,400 calculations. It checks names, dates, types, regions and which years fail, against independently exported PHP results. This verifies compatibility, not the legal completeness of every country's calendar.

The reference is [spatie/holidays at 0fd2962](https://github.com/spatie/holidays/commit/0fd2962c755d433a698e2a1bec9b76f3e756ebc5), using PHP 8.4.28, ICU 76.1, UTC and a clock fixed at midnight on January 1, 2024. The Rust port supplied implementation lessons and its parity-fixture approach. The current PHP source remains authoritative.

See [testdata/README.md](https://github.com/spatie/holidays-go/blob/main/testdata/README.md) for fixture and lunar-data provenance, regeneration commands and clock-dependent PHP behavior. PHP is only needed for maintenance exports, not for running this module or its Go tests.

 A good
match?
-------------

### What we do best

- All things Laravel
- Custom frontend components
- Building APIs
- AI-powered features
- Simplifying things
- Clean solutions
- Integrating services

### Not our cup of tea

- WordPress themes
- Cutting corners
- Free mockups to win a job
- "Just execute the briefing"

 In short: we'd like to be a **substantial part** of your project.

 [ Get in touch via email ](mailto:info@spatie.be?subject=A%20good%20match%21&body=Tell%20us%20as%20much%20as%20you%20can%20about%0A-%20your%20online%20project%0A-%20your%20planning%0A-%20your%20budget%0A-%20%E2%80%A6%0A%0AAnything%20that%20helps%20us%20to%20start%20straightforward%21)
