-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In CI added windows_latest, help added and array margin checking.
- Loading branch information
Showing
5 changed files
with
112 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# This is a basic workflow to help you get started with Actions | ||
|
||
name: CI | ||
|
||
# Controls when the workflow will run | ||
on: | ||
# Triggers the workflow on push or pull request events but only for the "master" branch | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
os: ["ubuntu-latest", "windows-latest"] | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Install V | ||
uses: vlang/setup-v@v1 | ||
with: | ||
check-latest: true | ||
|
||
- name: Checkout ${{ github.event.repository.name }} | ||
uses: actions/checkout@v2 | ||
|
||
# Does not check format since works different under different OS | ||
# - name: Check if code is formatted | ||
# run: | | ||
# v fmt -diff . | ||
# v fmt -verify . | ||
|
||
- name: Build ${{ github.event.repository.name }} | ||
run: v . -o cht | ||
|
||
- name: Run Tests | ||
run: v test . |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import os | ||
|
||
const output_search_terms = [ | ||
'Usage', | ||
'Options', | ||
'-T, --no_colors', | ||
'-TA,--force_ansi_colors' | ||
'--version', | ||
] | ||
|
||
fn test_help() { | ||
flags := ['--help', '-h'] | ||
|
||
for flag in flags { | ||
result := os.execute_or_panic(os.join_path(os.getwd(), "cht") + ' ${flag}') | ||
|
||
assert result.exit_code == 0 | ||
for term in output_search_terms { | ||
assert result.output.contains(term) | ||
} | ||
} | ||
} | ||
|
||
fn test_version() { | ||
flags := ['--version', '-V'] | ||
|
||
for flag in flags { | ||
result := os.execute_or_panic(os.join_path(os.getwd(), "cht") + ' ${flag}') | ||
|
||
assert result.exit_code == 0 | ||
for term in ['Panjtar', 'version'] { | ||
assert result.output.contains(term) | ||
} | ||
} | ||
} | ||
|
||
fn test_wrong_option() { | ||
flags := ['--Unsuported_long_option_with_agrument arg1', '--Unsuported_long_option', '-QWER'] | ||
|
||
for flag in flags { | ||
result := os.execute(os.join_path(os.getwd(), "cht") + ' ${flag}') | ||
|
||
assert result.exit_code == 1 | ||
assert result.output.contains('Unknown') | ||
} | ||
} |