forked from tinygo-org/tinygo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
os: add stubs for Readlink and File.Seek for baremetal targets, with …
…smoke test. Test currently enabled on pybadge (chosen at random) TODO: - enable test on arduino; currently fails with "interp: ptrtoint integer size..." (tinygo-org#2389) - enable test on nintendoswitch; currently fails with many missing definitions (tinygo-org#2530)
- Loading branch information
1 parent
626ef02
commit 291890a
Showing
3 changed files
with
37 additions
and
0 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
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,27 @@ | ||
package os_smoke_test | ||
|
||
// Simple smoke tests for the os package or things that depend on it. | ||
// Intended to catch build tag mistakes affecting bare metal targets. | ||
|
||
import ( | ||
"fmt" | ||
"path/filepath" | ||
"testing" | ||
) | ||
|
||
// Regression test for https://github.com/tinygo-org/tinygo/issues/2563 | ||
func TestFilepath(t *testing.T) { | ||
if filepath.Base("foo/bar") != "bar" { | ||
t.Errorf("filepath.Base is very confused") | ||
} | ||
} | ||
|
||
// Regression test for https://github.com/tinygo-org/tinygo/issues/2530 | ||
func TestFmt(t *testing.T) { | ||
n, err := fmt.Printf("Hello, world!\n") | ||
if err != nil { | ||
t.Errorf("printf returned error %s", err) | ||
} else if n != 14 { | ||
t.Errorf("printf returned %d, expected 14", n) | ||
} | ||
} |