Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantin8105 committed May 30, 2024
1 parent 8dda4c4 commit 9963ca3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 20 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: Go

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
on: [push, pull_request]

jobs:

Expand Down
4 changes: 2 additions & 2 deletions scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ mkdir -p ./testdata/
# github.com/Konstantin8105/c4go/version

# Package list
# export PKGS=$(go list -e ./... | grep -v testdata | grep -v examples | grep -v tests | grep -v vendor | tr '\n' ' ')
export PKGS="github.com/Konstantin8105/c4go github.com/Konstantin8105/c4go/types"
export PKGS=$(go list -e ./... | grep -v testdata | grep -v examples | grep -v tests | grep -v vendor | tr '\n' ' ')
# export PKGS="github.com/Konstantin8105/c4go github.com/Konstantin8105/c4go/util"

# View
echo "PKGS : $PKGS"
Expand Down
8 changes: 4 additions & 4 deletions util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ func IsLastArray(s string) bool {
// ParseFunction - parsing elements of C function
func ParseFunction(s string) (prefix string, funcname string, f []string, r []string, err error) {
defer func() {
if len(f) == 1 && f[0] == "void" {
f = nil
}

// fix bug in tests:
// if len(f) == 1 && f[0] == "void" {
// f = nil
// }
if err != nil {
err = fmt.Errorf("cannot parse function '%s' : %v", s, err)
} else {
Expand Down
18 changes: 9 additions & 9 deletions util/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,19 +275,19 @@ func TestResolveFunction(t *testing.T) {
if len(actualField) != len(tc.fields) {
a, _ := json.Marshal(actualField)
f, _ := json.Marshal(tc.fields)
t.Errorf("Size of field is not same.\nActual : %s\nExpected: %s\n",
string(a),
string(f))
return
}
if len(actualField) != len(tc.fields) {
a, _ := json.Marshal(actualField)
f, _ := json.Marshal(tc.fields)
t.Errorf("Size of field is not same.\nActual : %s\nExpected: %s\n",
t.Errorf("Size of field is not same.\nActual : `%s`\nExpected: `%s`\n",
string(a),
string(f))
return
}
// if len(actualField) != len(tc.fields) {
// a, _ := json.Marshal(actualField)
// f, _ := json.Marshal(tc.fields)
// t.Errorf("Size of field is not same.\nActual : `%s`\nExpected: `%s`\n",
// string(a),
// string(f))
// return
// }
for i := range actualField {
actualField[i] = strings.Replace(actualField[i], " ", "", -1)
tc.fields[i] = strings.Replace(tc.fields[i], " ", "", -1)
Expand Down

0 comments on commit 9963ca3

Please sign in to comment.