-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add stdlib test importing every stdlib module #795
Open
jiribenes
wants to merge
6
commits into
master
Choose a base branch
from
acme
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+209
−30
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a216b5b
Add stdlib test importing every stdlib module
jiribenes fc4a68a
Fix 'buffer', 'io/network', and 'json'
jiribenes b320ba7
Add ACME CI
jiribenes 4a696ac
CI: Try to fix ACME CI
jiribenes dc76d9e
Add forgotten 'seq' library to ACME example
jiribenes 78ece9a
Add ACME backronym
jiribenes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,52 @@ | ||
name: Check every stdlib module is compiled (acme) | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- 'libraries/common/**' | ||
|
||
jobs: | ||
check-stdlib-sync: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Generate acme and test for differences | ||
id: generate-acme | ||
shell: bash | ||
run: | | ||
# Function to convert file path to module import path | ||
path_to_module() { | ||
local filepath="$1" | ||
# Remove libraries/common/ prefix and .effekt suffix | ||
local module_path="${filepath#libraries/common/}" | ||
module_path="${module_path%.effekt}" | ||
echo "$module_path" | ||
} | ||
|
||
# Find all .effekt files in libraries/common, excluding acme.effekt | ||
MODULES=$(find libraries/common -type f -name "*.effekt" | sort | while read -r file; do | ||
path_to_module "$file" | ||
done) | ||
|
||
# Create the new acme.effekt content | ||
{ | ||
echo "/// This module is auto-generated and checked in CI." | ||
echo "/// It imports **every** stdlib module: ACME = All Common Modules in Effekt" | ||
echo "module acme" | ||
echo "" | ||
for module in $MODULES; do | ||
echo "import $module" | ||
done | ||
echo "" | ||
echo "def main() = ()" | ||
} > generated-acme.effekt | ||
|
||
# Compare files, ignoring whitespace, blank lines, and line ending differences | ||
if ! diff -Bbq examples/stdlib/acme.effekt generated-acme.effekt; then | ||
echo "::error::The stdlib import file (examples/stdlib/acme.effekt) is out of sync with the modules in libraries/common." | ||
echo "Differences found:" | ||
diff -Bu examples/stdlib/acme.effekt generated-acme.effekt | ||
exit 1 | ||
fi |
Empty file.
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,37 @@ | ||
/// This module is auto-generated and checked in CI. | ||
/// It imports **every** stdlib module: ACME = All Common Modules in Effekt | ||
module acme | ||
|
||
import args | ||
import array | ||
import bench | ||
import buffer | ||
import bytearray | ||
import char | ||
import dequeue | ||
import effekt | ||
import exception | ||
import io | ||
import io/console | ||
import io/error | ||
import io/filesystem | ||
import io/network | ||
import io/time | ||
import json | ||
import list | ||
import map | ||
import option | ||
import process | ||
import queue | ||
import ref | ||
import regex | ||
import result | ||
import scanner | ||
import seq | ||
import set | ||
import stream | ||
import string | ||
import test | ||
import tty | ||
|
||
def main() = () |
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,8 @@ | ||
1 | ||
false | ||
Some(17) | ||
Some(1) | ||
Some(2) | ||
Some(3) | ||
Some(4) | ||
Some(5) |
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 @@ | ||
import buffer | ||
|
||
def main() = buffer::examples::main() |
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,65 @@ | ||
a | ||
|
||
a | ||
|
||
a | ||
b | ||
f | ||
|
||
{ | ||
"x" | ||
: | ||
"Hallo" | ||
, | ||
"y" | ||
: | ||
null | ||
, | ||
"z" | ||
: | ||
12.3783 | ||
} | ||
|
||
{ | ||
"a" | ||
: | ||
null | ||
, | ||
"b" | ||
: | ||
[ | ||
true | ||
, | ||
false | ||
, | ||
false | ||
, | ||
true | ||
] | ||
, | ||
"f" | ||
: | ||
12.532 | ||
} | ||
|
||
{ | ||
"a" | ||
: | ||
null | ||
, | ||
"b" | ||
: | ||
[ | ||
true | ||
, | ||
false | ||
, | ||
false | ||
, | ||
true | ||
] | ||
, | ||
"f" | ||
: | ||
12.532 | ||
} |
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 @@ | ||
import json | ||
|
||
def main() = json::test::main() |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is semantically correct, we use it as a circular buffer, so we don't really need to invalidate the previous value -- we'd have overwritten it.