{"id":18473425,"url":"https://github.com/0xopenbytes/t","last_synced_at":"2025-08-01T07:38:54.601Z","repository":{"id":43684621,"uuid":"454989040","full_name":"0xOpenBytes/t","owner":"0xOpenBytes","description":"🧪 Quickly test expectations","archived":false,"fork":false,"pushed_at":"2023-03-02T01:09:54.000Z","size":480,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-03-15T12:49:34.332Z","etag":null,"topics":["ios","swift","testing","unit-testing"],"latest_commit_sha":null,"homepage":"https://0xopenbytes.github.io/t","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0xOpenBytes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-03T01:05:19.000Z","updated_at":"2024-01-07T20:46:26.000Z","dependencies_parsed_at":"2024-11-06T10:43:46.021Z","dependency_job_id":"34ba8d47-e937-4d52-8d56-eba26c78b249","html_url":"https://github.com/0xOpenBytes/t","commit_stats":{"total_commits":22,"total_committers":1,"mean_commits":22.0,"dds":0.0,"last_synced_commit":"c111675ac4d84af23d2d9b65bffaf1829c376986"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xOpenBytes%2Ft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xOpenBytes%2Ft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xOpenBytes%2Ft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xOpenBytes%2Ft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xOpenBytes","download_url":"https://codeload.github.com/0xOpenBytes/t/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247842662,"owners_count":21005321,"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":["ios","swift","testing","unit-testing"],"created_at":"2024-11-06T10:24:54.655Z","updated_at":"2025-04-08T12:31:51.607Z","avatar_url":"https://github.com/0xOpenBytes.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# t\n\n*Quickly test expectations*\n\n## What is `t`?\n\n`t` is a simple testing framework using closures and errors. You have the ability to create a `suite` that has multiple steps, expectations, and asserts. Expectations can be used to `expect` one or multiple assertions.\n\n## Where can `t` be used?\n\n`t` can be used to test quickly inside a function to make sure something is working as expected. `t` can also be used in unit tests if wanted.\n\n## Examples\n\n### t.suite\n```swift\nt.suite {\n    // Add an expectation that asserting true is true and that 2 is equal to 2\n    try t.expect {\n        try t.assert(true)\n        try t.assert(2, isEqualTo: 2)\n    }\n    \n    // Add an assertion that asserting false is not true\n    try t.assert(notTrue: false)\n    \n    // Add an assertion that \"Hello\" is not equal to \"World\"\n    try t.assert(\"Hello\", isNotEqualTo: \"World\")\n    \n    // Log a message\n    t.log(\"📣 Test Log Message\")\n    \n    // Log a t.error\n    t.log(error: t.error(description: \"Mock Error\"))\n    \n    // Log any error\n    struct SomeError: Error { }\n    t.log(error: SomeError())\n    \n    // Add an assertion to check if a value is nil\n    let someValue: String? = nil\n    try t.assert(isNil: someValue)\n    \n    // Add an assertion to check if a value is not nil\n    let someOtherValue: String? = \"💠\"\n    try t.assert(isNotNil: someOtherValue)\n}\n```\n\n### t.expect\n```swift\ntry t.expect {\n    let someValue: String? = \"Hello\"\n    try t.assert(isNil: someValue)\n}\n```\n\n### t.assert\n```swift\ntry t.assert(\"Hello\", isEqualTo: \"World\")\n```\n\n### t.log\n```swift\nt.log(\"📣 Test Log Message\")\n```\n\n### XCTest\n\n#### Assert suite is true\n```swift\nXCTAssert(\n    t.suite {\n        try t.assert(true)\n    }\n)\n```\n\n#### Assert expectation is true\n```swift\nXCTAssertNoThrow(\n    try t.expect(\"true is true and that 2 is equal to 2\") {\n        try t.assert(true)\n        try t.assert(2, isEqualTo: 2)\n    }\n)\n```\n\n#### Assert is false\n```swift\nXCTAssertThrowsError(\n    try t.assert(false)\n)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xopenbytes%2Ft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xopenbytes%2Ft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xopenbytes%2Ft/lists"}