Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yusukebe/t
t is a command line tool for testing on your terminal.
https://github.com/yusukebe/t
cli command-line golang terminal testing
Last synced: 22 days ago
JSON representation
t is a command line tool for testing on your terminal.
- Host: GitHub
- URL: https://github.com/yusukebe/t
- Owner: yusukebe
- License: mit
- Created: 2021-11-08T05:43:00.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2021-11-26T08:04:59.000Z (almost 3 years ago)
- Last Synced: 2024-10-06T08:16:38.204Z (about 1 month ago)
- Topics: cli, command-line, golang, terminal, testing
- Language: Go
- Homepage:
- Size: 37.1 KB
- Stars: 33
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# t
`t` is a command line tool for testing on your terminal.
![Terminal](https://user-images.githubusercontent.com/10682/140833442-541da082-8bbd-4637-9bbd-c57440a455a2.png)
## Installation
```
$ go install github.com/yusukebe/t/cmd/t@latest
```## Usage
Basic usage:
```
$ t hello hello # => PASS
``````
$ t hello hell # => FAIL
```With pipe:
```
$ echo "hello" | t hello # => PASS
```Eval:
```
$ t -e 10 "5*2" # => PASS
```With operator
```
$ t -o ">" 10 "3*2" # => PASS
```Regular expression:
```
$ t -m 'hello+' helloooooo # => PASS
```With [**jq**](https://stedolan.github.io/jq/):
```
$ echo '{ "message": "hello" }' | jq -r .message | t hello # => PASS
``````
$ echo '{ "number": 5 }' | jq -r .number | t 10 -o '>' # => PASS
```With [**rj**](https://github.com/yusukebe/rj), test the status is not error:
```
$ rj http://example.com/ | jq -r .code | t 500 -o '>'
```CircleCI, you can test if the http status is ok on CircleCI with **only** config.yml:
```yaml
version: 2.1
jobs:
test:
parameters:
url:
type: string
docker:
- image: cimg/go:1.17.3
steps:
- run:
command: go install github.com/yusukebe/rj/cmd/rj@latest
- run:
command: go install github.com/yusukebe/t/cmd/t@latest
- run:
name: Test << parameters.url >>
command: rj <> | jq '.code' | t 200
workflows:
test_workflow:
jobs:
- test:
url: https://example.com/
```Example repository:
*
## Author
Yusuke Wada
## License
MIT