-
Notifications
You must be signed in to change notification settings - Fork 166
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
a87d68a
commit 7684bd4
Showing
11 changed files
with
88 additions
and
118 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 |
---|---|---|
@@ -1,21 +1,8 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile | ||
{ | ||
"name": "Existing Dockerfile", | ||
"build": { | ||
// Sets the run context to one level up instead of the .devcontainer folder. | ||
"context": "..", | ||
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename. | ||
"dockerfile": "../Dockerfile" | ||
}, | ||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
// "features": {}, | ||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
// Uncomment the next line to run commands after the container is created. | ||
// "postCreateCommand": "cat /etc/os-release", | ||
// Configure tool-specific properties. | ||
// "customizations": {}, | ||
// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root. | ||
"remoteUser": "root" | ||
} |
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
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
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,23 +1,21 @@ | ||
use metacall::{ | ||
hooks, | ||
inline::{node, ts}, | ||
inline::{node, py, ts}, | ||
}; | ||
|
||
#[test] | ||
fn test_inline() { | ||
let _d = hooks::initialize().unwrap(); | ||
|
||
// TODO | ||
py! { | ||
print("hello world") | ||
} | ||
|
||
// py! { | ||
// print("hello world") | ||
// } | ||
node! { | ||
console.log("hello world"); | ||
} | ||
|
||
// node! { | ||
// console.log("hello world"); | ||
// } | ||
|
||
// ts! { | ||
// console.log("hello world"); | ||
// } | ||
ts! { | ||
console.log("hello world"); | ||
} | ||
} |
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,14 +1,31 @@ | ||
use metacall::{ | ||
hooks, loaders, | ||
}; | ||
use std::{env}; | ||
use metacall::{hooks, loaders, prelude::MetacallLoaderError}; | ||
use std::env; | ||
|
||
#[test] | ||
fn invalid_loader_test() { | ||
let _d = hooks::initialize().unwrap(); | ||
|
||
let tests_dir = env::current_dir().unwrap().join("tests/scripts"); | ||
let test_file = tests_dir.join("whatever.yeet"); | ||
let scripts_dir = env::current_dir().unwrap().join("tests/scripts"); | ||
let inavlid_file = scripts_dir.join("whatever.yeet"); | ||
let valid_file = scripts_dir.join("return_type_test.js"); | ||
|
||
loaders::from_file("random", [test_file]).unwrap(); | ||
if let Err(MetacallLoaderError::FileNotFound(_)) = loaders::from_file("random", inavlid_file) { | ||
// Everything Ok | ||
} else { | ||
panic!("Expected the loader fail with `FileNotFound` error variant!"); | ||
} | ||
|
||
if let Err(MetacallLoaderError::FromFileFailure) = loaders::from_file("random", valid_file) { | ||
// Everything Ok | ||
} else { | ||
panic!("Expected the loader fail with `FromFileFailure` error variant!"); | ||
} | ||
|
||
if let Err(MetacallLoaderError::FromMemoryFailure) = | ||
loaders::from_memory("random", "Invalid code!") | ||
{ | ||
// Everything Ok | ||
} else { | ||
panic!("Expected the loader fail with `FromMemoryFailure` error variant!"); | ||
} | ||
} |
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