aboutsummaryrefslogtreecommitdiff
path: root/lib/memfs/embed_test.go
AgeCommit message (Collapse)Author
2026-01-15all: convert license and copyright to use SPDX identifiersShulhan
With help of spdxconv tool [1], we able to bulk update all files license and copyright format to comply with SPDX formats. [1] https://kilabit.info/project/spdxconv/
2025-01-06lib/memfs: remove GoEmbed test that generate dynamic timesShulhan
The GoEmbed test that write Go embedded code into "internal/test/embed/" may create unnecessary changes when the test run on new clone of this repository, or when we run "go test" again on that package after rebasing.
2022-02-14lib/memfs: add option CommentHeader to EmbedOptionsShulhan
The CommentHeader option allow user to define custom header to the Go generated file. The string value is not checked, whether it's a comment or not, it will rendered as is.
2021-10-26lib/memfs: move the go embed test to directory internal/testShulhan
This is to remove "embed_test" being displayed on the documentation page.
2021-10-26lib/memfs: move the embedded parameter to OptionsShulhan
Since the GoEmbed can be called only when MemFS instance is initiated, it would be better if parameters for GoEmbed also initialized in the struct Options. In this way any additional parameters needed to add to GoEmbed does not changes the method signature in the future. This commit add new type EmbedOptions that contains the parameters for GoEmbed. In this new type, we add new field EmbedWithoutModTime. if its true, the modification time for all files and directories are not stored inside generated code, instead all files will use the current time when the program is running.
2021-10-10lib/memfs: fix the embed test file namesShulhan
The variable memFS is exist only on test file, but if the file name for generated GoEmbed is not _test.go the "go install /lib/memfs/..." will thrown an error go install ./... # github.com/shuLhan/share/lib/memfs/embed_test lib/memfs/embed_test/memfs_embed.go:20:31: undefined: memFS lib/memfs/embed_test/memfs_embed.go:21:31: undefined: memFSR
2021-10-09lib/memfs: use temporary directory for testing Node.Save()Shulhan
Previously we use the "testdata" for output of Node.Save() test. This is caused the modified time on "testdata" get changes every time we run the test and cause the embed_test failed. This changes use temporary directory and revert part of Node Save() unit test from commit 792ba17ac1f.