mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-19 19:08:05 +08:00
comment out tests
This commit is contained in:
@@ -1,17 +1,15 @@
|
||||
use crate::node_registry::{CACHE_NODES, NODE_REGISTRY};
|
||||
use dyn_any::StaticType;
|
||||
use graph_craft::document::ProtonodeEntry;
|
||||
use graph_craft::document::value::{TaggedValue, UpcastNode};
|
||||
use graph_craft::proto::{ConstructionArgs, GraphError, LocalFuture, NodeContainer, ProtoNetwork, ProtoNode, SharedNodeContainer, TypeErasedBox, TypingContext, UpstreamInputMetadata};
|
||||
use graph_craft::proto::{GraphErrorType, GraphErrors};
|
||||
use graph_craft::{Type, concrete};
|
||||
use graphene_std::Context;
|
||||
use graphene_std::any::{EditorContext, EditorContextToContext, NullificationNode};
|
||||
use graphene_std::memo::IntrospectMode;
|
||||
use graphene_std::uuid::{CompiledProtonodeInput, NodeId, SNI};
|
||||
use graphene_std::{Context, MemoHash};
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::error::Error;
|
||||
use std::ptr::null;
|
||||
use std::sync::Arc;
|
||||
|
||||
/// An executor of a node graph that does not require an online compilation server, and instead uses `Box<dyn ...>`.
|
||||
@@ -365,13 +363,6 @@ impl BorrowTree {
|
||||
// Move the value into the upcast node instead of cloning it
|
||||
match proto_node.construction_args {
|
||||
ConstructionArgs::Value(value_args) => {
|
||||
// The constructor for nodes with value construction args (value nodes) is not called.
|
||||
// let node = if let TaggedValue::ApplicationIo(api) = &*value {
|
||||
// let editor_api = UpcastAsRefNode::new(api.clone());
|
||||
// let node = Box::new(editor_api) as TypeErasedBox<'_>;
|
||||
// NodeContainer::new(node)
|
||||
// } else {
|
||||
|
||||
let upcasted = UpcastNode::new(value_args.value);
|
||||
let node = Box::new(upcasted) as TypeErasedBox<'_>;
|
||||
let value_node = NodeContainer::new(node);
|
||||
@@ -477,17 +468,23 @@ impl BorrowTree {
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use super::*;
|
||||
use graph_craft::document::value::TaggedValue;
|
||||
use graph_craft::{document::value::TaggedValue, proto::NodeValueArgs};
|
||||
use graphene_std::uuid::NodeId;
|
||||
|
||||
#[test]
|
||||
fn push_node_sync() {
|
||||
let mut tree = BorrowTree::default();
|
||||
let val_1_protonode = ProtoNode::value(ConstructionArgs::Value(TaggedValue::U32(2u32).into()), NodeId(0));
|
||||
let val_1_protonode = ProtoNode::value(
|
||||
ConstructionArgs::Value(NodeValueArgs {
|
||||
value: TaggedValue::U32(2u32).into(),
|
||||
connector_paths: Vec::new(),
|
||||
}),
|
||||
NodeId(0),
|
||||
);
|
||||
let context = TypingContext::default();
|
||||
let future = tree.push_node(val_1_protonode, &context);
|
||||
futures::executor::block_on(future).unwrap();
|
||||
let _node = tree.get(NodeId(0)).unwrap();
|
||||
let _node = tree.nodes.get(&NodeId(0)).expect("Node should be added to tree");
|
||||
let result = futures::executor::block_on(tree.eval(NodeId(0), ()));
|
||||
assert_eq!(result, Some(2u32));
|
||||
}
|
||||
|
||||
@@ -6,13 +6,14 @@ pub mod util;
|
||||
mod tests {
|
||||
use futures::executor::block_on;
|
||||
use graphene_core::*;
|
||||
use graphene_std::uuid::NodeId;
|
||||
|
||||
#[test]
|
||||
fn double_number() {
|
||||
use graph_craft::document::*;
|
||||
use graph_craft::*;
|
||||
|
||||
let network = NodeNetwork {
|
||||
let mut network = NodeNetwork {
|
||||
exports: vec![NodeInput::node(NodeId(1), 0)],
|
||||
nodes: [
|
||||
// Simple identity node taking a number as input from outside the graph
|
||||
@@ -40,9 +41,7 @@ mod tests {
|
||||
};
|
||||
|
||||
use crate::dynamic_executor::DynamicExecutor;
|
||||
use graph_craft::graphene_compiler::Compiler;
|
||||
|
||||
let compiler = Compiler {};
|
||||
let protonetwork = network.flatten().map(|result| result.0).expect("Graph should be generated");
|
||||
|
||||
let _exec = block_on(DynamicExecutor::new(protonetwork)).map(|_e| panic!("The network should not type check ")).unwrap_err();
|
||||
|
||||
@@ -24,7 +24,6 @@ use std::collections::HashMap;
|
||||
#[cfg(feature = "gpu")]
|
||||
use std::sync::Arc;
|
||||
#[cfg(feature = "gpu")]
|
||||
use wgpu_executor::WgpuExecutor;
|
||||
use wgpu_executor::{WgpuSurface, WindowHandle};
|
||||
|
||||
// TODO: turn into hashmap
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
use graph_craft::ProtoNodeIdentifier;
|
||||
use graph_craft::concrete;
|
||||
use graph_craft::document::value::EditorMetadata;
|
||||
use graph_craft::document::value::RenderOutput;
|
||||
use graph_craft::document::value::TaggedValue;
|
||||
use graph_craft::document::{DocumentNode, DocumentNodeImplementation, NodeInput, NodeNetwork};
|
||||
use graph_craft::generic;
|
||||
|
||||
Reference in New Issue
Block a user