{"id":22339832,"url":"https://github.com/rahugg/automatization-test-cases-csv","last_synced_at":"2025-07-27T12:34:08.835Z","repository":{"id":197922334,"uuid":"699659666","full_name":"Rahugg/Automatization-test-cases-csv","owner":"Rahugg","description":"Write your test cases with a csv in Golang","archived":false,"fork":false,"pushed_at":"2023-10-03T04:59:22.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-31T10:29:05.457Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rahugg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-03T04:40:32.000Z","updated_at":"2023-10-03T04:59:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"4dd5243a-c98b-40bc-b7e8-b474ec86a3f1","html_url":"https://github.com/Rahugg/Automatization-test-cases-csv","commit_stats":null,"previous_names":["rahugg/automatization-test-cases-csv"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rahugg%2FAutomatization-test-cases-csv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rahugg%2FAutomatization-test-cases-csv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rahugg%2FAutomatization-test-cases-csv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rahugg%2FAutomatization-test-cases-csv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rahugg","download_url":"https://codeload.github.com/Rahugg/Automatization-test-cases-csv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245623078,"owners_count":20645680,"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":[],"created_at":"2024-12-04T07:09:31.581Z","updated_at":"2025-03-26T09:13:59.013Z","avatar_url":"https://github.com/Rahugg.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Simple Automatization test cases in Golang \n\nThis project contains a test suite for verifying the correctness of a square root function. The tests are driven by data from a CSV file (`sqrt_cases.csv`), making it easy to extend with additional test cases.\n\n## Overview\n\nThe core of the project is the `TestSqrt` function, which reads test cases from the `sqrt_cases.csv` file and then runs a series of subtests. Each subtest checks if the square root function (`Sqrt`) correctly calculates the square root of a given value, within a specified tolerance.\n\n## File Structure\n\n- `main.go`: This file should contain the main square root function `Sqrt`.\n- `sqrt_test.go`: Contains the testing logic and the utility function to load test cases.\n- `sqrt_cases.csv`: Contains the simple test cases for Sqrt function\n## How the Test Works\n\n1. The `loadSqrtCases` function reads test cases from the `sqrt_cases.csv` file. Each line in the CSV represents a test case with two values: the input number and the expected square root value.\n2. For each test case, `TestSqrt` creates a subtest using the input value as its name.\n3. The subtest then calls the `Sqrt` function, checks if there are no errors, and asserts that the computed square root is close to the expected value (within a tolerance of 0.001).\n\n## Usage\n\n1. Ensure you have the `github.com/stretchr/testify/require` package installed. If not, you can install it using:\n   ```\n   go get github.com/stretchr/testify/require\n   ```\n\n2. To run the tests, navigate to the directory containing the code and execute:\n   ```\n   go test\n   ```\n\n3. Add or modify test cases by editing the `sqrt_cases.csv` file. Follow the format of input value, and expected result.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahugg%2Fautomatization-test-cases-csv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frahugg%2Fautomatization-test-cases-csv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahugg%2Fautomatization-test-cases-csv/lists"}