Skip to content

Commit

Permalink
fix(ops): circular dependency in deno_ops test (denoland#16809)
Browse files Browse the repository at this point in the history
  • Loading branch information
littledivy authored Nov 25, 2022
1 parent d80af83 commit 8fc62f9
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 74 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion ops/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ regex.workspace = true
syn.workspace = true

[dev-dependencies]
deno_core.workspace = true
prettyplease = "0.1.21"
testing_macros = "0.2.7"
trybuild = "1.0.71"
1 change: 1 addition & 0 deletions ops/deno.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
#![cfg(not(test))]

use proc_macro2::{Span, TokenStream};
use proc_macro_crate::{crate_name, FoundCrate};
Expand Down
2 changes: 1 addition & 1 deletion ops/fast_call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ mod tests {
#[testing_macros::fixture("optimizer_tests/**/*.rs")]
fn test_fast_call_codegen(input: PathBuf) {
let update_expected = std::env::var("UPDATE_EXPECTED").is_ok();
let core = crate::deno::import();
let core = quote!(deno_core);

let source =
std::fs::read_to_string(&input).expect("Failed to read test file");
Expand Down
7 changes: 4 additions & 3 deletions ops/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ mod deno;
mod fast_call;
mod optimizer;

#[cfg(test)]
mod tests;

const SCOPE_LIFETIME: &str = "'scope";

/// Add the 'scope lifetime to the function signature.
Expand Down Expand Up @@ -60,6 +57,10 @@ impl Op {

let is_async = item.sig.asyncness.is_some() || is_future(&item.sig.output);
let type_params = exclude_lifetime_params(&item.sig.generics.params);

#[cfg(test)]
let core = quote!(deno_core);
#[cfg(not(test))]
let core = deno::import();

Self {
Expand Down
11 changes: 0 additions & 11 deletions ops/tests/01_fast_callback_options.rs

This file was deleted.

29 changes: 0 additions & 29 deletions ops/tests/compile_fail/unsupported.rs

This file was deleted.

22 changes: 0 additions & 22 deletions ops/tests/compile_fail/unsupported.stderr

This file was deleted.

6 changes: 0 additions & 6 deletions ops/tests/mod.rs

This file was deleted.

0 comments on commit 8fc62f9

Please sign in to comment.