-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4900dd5
commit eefc97b
Showing
3 changed files
with
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Make sure we can read unicode characters. This is to make sure the utilities | ||
// we compile using pnut-sh can process all kind of files. | ||
// This test is not essential for the bootstrap but being able to properly read | ||
// non-ascii characters makes pnut more general. | ||
// | ||
// Yash's IO is a little bit weird and it's not a very popular shell, disabling the test for now. | ||
// expect_failure_for: yash | ||
|
||
#ifndef PNUT_CC | ||
#include <stdio.h> | ||
#else | ||
typedef int FILE; | ||
#endif | ||
|
||
void putstr(const char *s) { | ||
while (*s) { | ||
putchar(*s); | ||
s++; | ||
} | ||
} | ||
|
||
void main() { | ||
int i = 0; | ||
char c; | ||
FILE *f = fopen("tests/_all/input-output/unicode.txt", "r"); | ||
putstr("printf? 💣\n"); | ||
while ((c = fgetc(f)) != -1) { | ||
putchar(c); | ||
} | ||
} |
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,3 @@ | ||
printf? 💣 | ||
accents: éôèà | ||
some emoji: 🥜 |
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,2 @@ | ||
accents: éôèà | ||
some emoji: 🥜 |