{"id":28237261,"url":"https://github.com/just-do-halee/lum","last_synced_at":"2025-06-10T15:30:31.453Z","repository":{"id":64297796,"uuid":"565354545","full_name":"just-do-halee/lum","owner":"just-do-halee","description":"A simple, ergonomic test tool in Go (Amazingly small package)","archived":false,"fork":false,"pushed_at":"2022-11-15T12:21:40.000Z","size":37,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-19T00:17:58.219Z","etag":null,"topics":["go","go-package","golang","test","test-driven-development","testing"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/just-do-halee.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["just-do-halee"]}},"created_at":"2022-11-13T05:48:17.000Z","updated_at":"2022-11-15T11:44:01.000Z","dependencies_parsed_at":"2023-01-15T09:01:14.702Z","dependency_job_id":null,"html_url":"https://github.com/just-do-halee/lum","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/just-do-halee%2Flum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/just-do-halee%2Flum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/just-do-halee%2Flum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/just-do-halee%2Flum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/just-do-halee","download_url":"https://codeload.github.com/just-do-halee/lum/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/just-do-halee%2Flum/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259101000,"owners_count":22805186,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","go-package","golang","test","test-driven-development","testing"],"created_at":"2025-05-19T00:17:55.861Z","updated_at":"2025-06-10T15:30:31.440Z","avatar_url":"https://github.com/just-do-halee.png","language":"Go","funding_links":["https://github.com/sponsors/just-do-halee"],"categories":[],"sub_categories":[],"readme":"\n# **`Lum`**\n\n`Lum` is a simple, ergonomic test tool in Go (Amazingly small package).\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/just-do-halee/lum.svg)](https://pkg.go.dev/github.com/just-do-halee/lum)\n[![CI][ci-badge]][ci-url]\n[![Licensed][license-badge]][license-url]\n[![Twitter][twitter-badge]][twitter-url]\n\n[ci-badge]: https://github.com/just-do-halee/lum/actions/workflows/ci.yml/badge.svg\n[license-badge]: https://img.shields.io/github/license/just-do-halee/lum?labelColor=383636\n[twitter-badge]: https://img.shields.io/twitter/follow/do_halee?style=flat\u0026logo=twitter\u0026color=4a4646\u0026labelColor=333131\u0026label=just-do-halee\n[ci-url]: https://github.com/just-do-halee/lum/actions\n[twitter-url]: https://twitter.com/do_halee\n[license-url]: https://github.com/just-do-halee/lum\n\n| [Examples](./examples/) | [Latest Note](./CHANGELOG.md) |\n\n```shell\ngo get -u github.com/just-do-halee/lum@latest\n```\n\n## **`Template`**\n\n```go\nimport (\n    \"testing\"\n\n    \"github.com/just-do-halee/lum\"\n)\n\nfunc TestFn(t *testing.T) {\n    type Args struct {\n        a, b int\n    }\n    type Ret = int\n    type Ctx = *lum.Context[Args, Ret]\n    lum.Batch[Args, Ret]{\n        {\n            Name: \"description\",\n            Args: Args{0, 0},\n            Pass: lum.Todo[Args, Ret]()\n        },\n    }.Run(t, \"Fn\", nil, nil)\n}\n```\n\n## **`How to use,`**\n\n```go\npackage example\n\nfunc Sum(a, b int) int { return a + b }\n```\n\n```go\npackage example\n\nimport (\n    \"testing\"\n\n    \"github.com/just-do-halee/lum\"\n)\n\nfunc TestSum(t *testing.T) {\n    // ... Before All ...\n\n    // Test Function Arguments\n    type Args struct {\n        a, b int\n    }\n    // Return Type\n    type Ret = int \n    // Context Alias\n    type Ctx = *lum.Context[Args, Ret]\n\n    lum.Batch[Args, Ret]{\n        {\n            Name: \"1 + 1 = 2\",\n            Args: Args{1, 1},\n            Pass: func(c Ctx) {\n                // ... Assert ...\n                c.AssertResultEqual(2)\n            },\n        },\n        {\n            Name: \"3 \u003e 1 + 3 \u003c 5\",\n            Args: Args{1, 3},\n            Pass: func(c Ctx) {\n                // ... Assert ...\n                c.Log(c.Arguments)\n                c.Logf(\"result: %v\", c.Result)\n\n                c.Assert(c.Result \u003e 3, \"should be more than 3\")\n                c.Assertf(c.Result \u003c 5, \"should be less than %v\", 5)\n            },\n        },\n        {\n            Name: \"3 + 5 ...?\",\n            Args: Args{3, 5},\n            // This is unimplemented, so it won't occur any error\n        },\n        {\n            Name: \"2 + 4 != 7\",\n            Args: Args{2, 4},\n            // This is todo, so it will occur an error has meta message\n            Pass: lum.Todo[Args, Ret](\"not equal testing\"),\n        },\n    }.Run(t, \"Sum\", func(a Args) Ret {\n        // ... Before Each ...\n\n        // Call The Actual Function\n        return Sum(a.a, a.b)\n\n    }, func(c Ctx) {\n        // ... After Each ...\n    })\n    \n    // ... After All ...\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjust-do-halee%2Flum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjust-do-halee%2Flum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjust-do-halee%2Flum/lists"}