mirror of
https://github.com/RGBCube/color.v
synced 2025-07-30 17:37:45 +00:00
chore: add tests
This commit is contained in:
parent
cf8a4669f9
commit
820fae1ae0
3 changed files with 35 additions and 4 deletions
20
.github/workflows/test.yml
vendored
Normal file
20
.github/workflows/test.yml
vendored
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
name: Test
|
||||||
|
|
||||||
|
on:
|
||||||
|
- pull_request
|
||||||
|
- push
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Set Up V
|
||||||
|
uses: vlang/setup-v@v1.1
|
||||||
|
with:
|
||||||
|
check-latest: true
|
||||||
|
|
||||||
|
- name: Checkout Repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: v test ./
|
|
@ -33,9 +33,9 @@ Here are some examples to get you started:
|
||||||
```v oksyntax
|
```v oksyntax
|
||||||
import rgbcube.color
|
import rgbcube.color
|
||||||
|
|
||||||
color.red.println('Hello World')
|
color.red.println('Hello, World!')
|
||||||
color.cyan.println_bg('Hello World')
|
color.cyan.println_bg('Hello, World!')
|
||||||
color.bold.println('Hello World')
|
color.bold.println('Hello, World!')
|
||||||
```
|
```
|
||||||
|
|
||||||
### Advanced
|
### Advanced
|
||||||
|
@ -49,7 +49,7 @@ brush := color.new_brush(
|
||||||
styles: [color.bold, color.underline, color.italic]
|
styles: [color.bold, color.underline, color.italic]
|
||||||
)
|
)
|
||||||
|
|
||||||
brush.println('Hello World')
|
brush.println('Hello, World!')
|
||||||
```
|
```
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
11
src/brush_test.v
Normal file
11
src/brush_test.v
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
module color
|
||||||
|
|
||||||
|
fn test_brush() {
|
||||||
|
brush := new_brush(
|
||||||
|
fg: bright_white
|
||||||
|
bg: bright_red
|
||||||
|
styles: [bold, underline]
|
||||||
|
)
|
||||||
|
|
||||||
|
brush.println('Hello, World!')
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue