-
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.
fix(std:scanln): don't use buffers because it didn't work well in tes…
…t env (and maybe problem was biffer than just tests); fix(e2e): upd tests after movign from interpreter
- Loading branch information
Showing
36 changed files
with
304 additions
and
185 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,30 @@ | ||
package test | ||
|
||
import ( | ||
"os/exec" | ||
"strings" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func Test(t *testing.T) { | ||
for i := 0; i < 1; i++ { | ||
t.Run("Add numbers from stdin", func(t *testing.T) { | ||
cmd := exec.Command("neva", "run", "main") | ||
|
||
cmd.Stdin = strings.NewReader("3\n4\n\n") | ||
|
||
out, err := cmd.CombinedOutput() | ||
require.NoError(t, err) | ||
|
||
require.Equal( | ||
t, | ||
"7\n", | ||
string(out), | ||
) | ||
|
||
require.Equal(t, 0, cmd.ProcessState.ExitCode()) | ||
}) | ||
} | ||
} |
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,30 @@ | ||
package test | ||
|
||
import ( | ||
"os/exec" | ||
"strings" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func Test(t *testing.T) { | ||
for i := 0; i < 1; i++ { | ||
t.Run("Add numbers from stdin", func(t *testing.T) { | ||
cmd := exec.Command("neva", "run", "main") | ||
|
||
cmd.Stdin = strings.NewReader("3\n4\n\n") | ||
|
||
out, err := cmd.CombinedOutput() | ||
require.NoError(t, err) | ||
|
||
require.Equal( | ||
t, | ||
"7\n", | ||
string(out), | ||
) | ||
|
||
require.Equal(t, 0, cmd.ProcessState.ExitCode()) | ||
}) | ||
} | ||
} |
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,30 @@ | ||
package test | ||
|
||
import ( | ||
"os/exec" | ||
"strings" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func Test(t *testing.T) { | ||
for i := 0; i < 1; i++ { | ||
t.Run("Add numbers from stdin", func(t *testing.T) { | ||
cmd := exec.Command("neva", "run", "main") | ||
|
||
cmd.Stdin = strings.NewReader("3\n4\n\n") | ||
|
||
out, err := cmd.CombinedOutput() | ||
require.NoError(t, err) | ||
|
||
require.Equal( | ||
t, | ||
"7\n", | ||
string(out), | ||
) | ||
|
||
require.Equal(t, 0, cmd.ProcessState.ExitCode()) | ||
}) | ||
} | ||
} |
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,30 @@ | ||
package test | ||
|
||
import ( | ||
"os/exec" | ||
"strings" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func Test(t *testing.T) { | ||
for i := 0; i < 1; i++ { | ||
t.Run("Add numbers from stdin", func(t *testing.T) { | ||
cmd := exec.Command("neva", "run", "main") | ||
|
||
cmd.Stdin = strings.NewReader("3\n4\n\n") | ||
|
||
out, err := cmd.CombinedOutput() | ||
require.NoError(t, err) | ||
|
||
require.Equal( | ||
t, | ||
"7\n", | ||
string(out), | ||
) | ||
|
||
require.Equal(t, 0, cmd.ProcessState.ExitCode()) | ||
}) | ||
} | ||
} |
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,30 @@ | ||
package test | ||
|
||
import ( | ||
"os/exec" | ||
"strings" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func Test(t *testing.T) { | ||
for i := 0; i < 1; i++ { | ||
t.Run("Add numbers from stdin", func(t *testing.T) { | ||
cmd := exec.Command("neva", "run", "main") | ||
|
||
cmd.Stdin = strings.NewReader("3\n4\n\n") | ||
|
||
out, err := cmd.CombinedOutput() | ||
require.NoError(t, err) | ||
|
||
require.Equal( | ||
t, | ||
"7\n", | ||
string(out), | ||
) | ||
|
||
require.Equal(t, 0, cmd.ProcessState.ExitCode()) | ||
}) | ||
} | ||
} |
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 |
---|---|---|
@@ -1,15 +1,11 @@ | ||
flow Main(start any) (stop any) { | ||
adder Add<int> | ||
sequencer ArrPortToStream<int> | ||
println Println<int> | ||
|
||
--- | ||
|
||
:start -> [ | ||
(1 -> sequencer:port[0]), | ||
(2 -> sequencer:port[1]) | ||
(1 -> adder:acc), | ||
(2 -> adder:el) | ||
] | ||
sequencer:data -> adder:data | ||
adder:res -> println:data | ||
println:sig -> :stop | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import { io } | ||
|
||
flow Main(start any) (stop any) { | ||
scanner io.Scanln | ||
io.Scanln | ||
println Println<string> | ||
--- | ||
:start -> scanner:sig | ||
scanner:data -> println:data | ||
:start -> scanln:sig | ||
scanln:res -> println:data | ||
println:sig -> :stop | ||
} |
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
Oops, something went wrong.