Skip to content

Commit

Permalink
Merge pull request #1920 from xushiwei/q
Browse files Browse the repository at this point in the history
testdata => demo
  • Loading branch information
xushiwei authored Jul 9, 2024
2 parents 433c339 + 0e18a0b commit 8a5badc
Show file tree
Hide file tree
Showing 52 changed files with 28 additions and 28 deletions.
8 changes: 4 additions & 4 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ nfpms:
dst: "/usr/lib/{{ .ProjectName }}/scanner"
- src: "test"
dst: "/usr/lib/{{ .ProjectName }}/test"
- src: "testdata"
dst: "/usr/lib/{{ .ProjectName }}/testdata"
- src: "demo"
dst: "/usr/lib/{{ .ProjectName }}/demo"
- src: "tidy.go"
dst: "/usr/lib/{{ .ProjectName }}/tidy.go"
- src: "token"
Expand Down Expand Up @@ -338,8 +338,8 @@ snapcrafts:
destination: "scanner"
- source: "test"
destination: "test"
- source: "testdata"
destination: "testdata"
- source: "demo"
destination: "demo"
- source: "tidy.go"
destination: "tidy.go"
- source: "token"
Expand Down
2 changes: 1 addition & 1 deletion cmd/make.go
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ func runRegtests() {
cmd := exec.Command(filepath.Join(gopRoot, "bin/"+gopBinFiles[0]), "go", "./...")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cmd.Dir = filepath.Join(gopRoot, "testdata")
cmd.Dir = filepath.Join(gopRoot, "demo")
err := cmd.Run()
if err != nil {
code := cmd.ProcessState.ExitCode()
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions demo/gop-sample/b.gop
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package main

import (
ab "github.com/goplus/gop/demo/gop-sample/cpkag/b"
)

a()
Ab()
ab.Ab()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion doc/classfile.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func foo(v int) int {
}
```

Then you can create a `foo_test.gox` file to test it (see [unit-test/foo_test.gox](../testdata/unit-test/foo_test.gox)):
Then you can create a `foo_test.gox` file to test it (see [unit-test/foo_test.gox](../demo/unit-test/foo_test.gox)):

```go
if v := foo(50); v != 100 {
Expand Down
2 changes: 1 addition & 1 deletion doc/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,7 @@ By default `gop watch` does not convert test files (normally ending with `_test.

## Calling C from Go+

Here is [an example to show how Go+ interacts with C](https://github.com/goplus/gop/tree/main/testdata/_llgo/hellollgo).
Here is [an example to show how Go+ interacts with C](https://github.com/goplus/gop/tree/main/demo/_llgo/hellollgo).

```go
import "c"
Expand Down
12 changes: 6 additions & 6 deletions doc/overload.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Overload Func/Method/Operator/Types

### Overload Funcs

Define `overload func` in `inline func literal` style (see [overloadfunc1/add.gop](testdata/overloadfunc1/add.gop)):
Define `overload func` in `inline func literal` style (see [overloadfunc1/add.gop](demo/overloadfunc1/add.gop)):

```go
func add = (
Expand All @@ -19,7 +19,7 @@ println add(100, 7)
println add("Hello", "World")
```

Define `overload func` in `ident` style (see [overloadfunc2/mul.gop](testdata/overloadfunc2/mul.gop)):
Define `overload func` in `ident` style (see [overloadfunc2/mul.gop](demo/overloadfunc2/mul.gop)):

```go
func mulInt(a, b int) int {
Expand All @@ -41,7 +41,7 @@ println mul(1.2, 3.14)

### Overload Methods

Define `overload method` (see [overloadmethod/method.gop](testdata/overloadmethod/method.gop)):
Define `overload method` (see [overloadmethod/method.gop](demo/overloadmethod/method.gop)):

```go
type foo struct {
Expand Down Expand Up @@ -69,7 +69,7 @@ var d = a.mul(c)

### Overload Unary Operators

Define `overload unary operator` (see [overloadop1/overloadop.gop](testdata/overloadop1/overloadop.gop)):
Define `overload unary operator` (see [overloadop1/overloadop.gop](demo/overloadop1/overloadop.gop)):

```go
type foo struct {
Expand All @@ -91,7 +91,7 @@ a++

### Overload Binary Operators

Define `overload binary operator` (see [overloadop1/overloadop.gop](testdata/overloadop1/overloadop.gop)):
Define `overload binary operator` (see [overloadop1/overloadop.gop](demo/overloadop1/overloadop.gop)):

```go
type foo struct {
Expand All @@ -112,7 +112,7 @@ var c = a * b
var d = a != b
```

However, `binary operator` usually need to support interoperability between multiple types. In this case it becomes more complex (see [overloadop2/overloadop.gop](testdata/overloadop2/overloadop.gop)):
However, `binary operator` usually need to support interoperability between multiple types. In this case it becomes more complex (see [overloadop2/overloadop.gop](demo/overloadop2/overloadop.gop)):

```go
type foo struct {
Expand Down
2 changes: 1 addition & 1 deletion parser/_testdata/mytest/mytest.gop
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package testdata
package demo

import (
"go/token"
Expand Down
2 changes: 1 addition & 1 deletion parser/_testdata/mytest/parser.expect
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package testdata
package demo

file mytest.gop
ast.GenDecl:
Expand Down
2 changes: 1 addition & 1 deletion printer/printer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
)

const (
dataDir = "testdata"
dataDir = "demo"
tabwidth = 8
)

Expand Down
9 changes: 0 additions & 9 deletions testdata/gop-sample/b.gop

This file was deleted.

6 changes: 3 additions & 3 deletions x/build/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -500,11 +500,11 @@ func TestError(t *testing.T) {
if err == nil {
t.Fatal("BuildFile: no error?")
}
_, err = ctx.BuildDir("./testdata/nofound")
_, err = ctx.BuildDir("./demo/nofound")
if err == nil {
t.Fatal("BuildDir: no error?")
}
_, err = ctx.BuildFSDir(fsx.Local, "./testdata/nofound")
_, err = ctx.BuildFSDir(fsx.Local, "./demo/nofound")
if err == nil {
t.Fatal("BuildDir: no error?")
}
Expand All @@ -516,7 +516,7 @@ func TestError(t *testing.T) {
if err == nil {
t.Fatal("ParseFile: no error?")
}
_, err = ctx.ParseFile("./testdata/nofound/main.gop", nil)
_, err = ctx.ParseFile("./demo/nofound/main.gop", nil)
if err == nil {
t.Fatal("ParseFile: no error?")
}
Expand Down

0 comments on commit 8a5badc

Please sign in to comment.