fn copy_paste_single_layer() {
		init_logger();
		let mut editor = create_editor_with_three_layers();

		let document_before_copy = editor.dispatcher.document_message_handler.active_document().document.clone();
		editor.handle_message(Message::Document(DocumentMessage::CopySelectedLayers)).unwrap();
		editor.handle_message(Message::Document(DocumentMessage::PasteLayers { path: vec![], insert_index: -1 })).unwrap();
		let document_after_copy = editor.dispatcher.document_message_handler.active_document().document.clone();

		let layers_before_copy = document_before_copy.root.as_folder().unwrap().layers();
		let layers_after_copy = document_after_copy.root.as_folder().unwrap().layers();

		assert_eq!(layers_before_copy.len(), 3);
		assert_eq!(layers_after_copy.len(), 4);

		// Existing layers are unaffected
		for i in 0..=2 {
			assert_eq!(layers_before_copy[i], layers_after_copy[i]);
		}

		// The ellipse was copied
		assert_eq!(layers_before_copy[2], layers_after_copy[3]);
	}
/// - create rect, shape and ellipse
/// - copy
/// - paste
/// - assert that ellipse was copied
create rect, shape and ellipse
copy
paste
assert that ellipse was copied
create rect shape and ellipse copy paste assert that ellipse was copied
fn copy_paste_single_layer() {
		init_logger();
		let mut editor = create_editor_with_three_layers();
		let document_before_copy = editor.dispatcher.document_message_handler.active_document().document.clone();
		editor.handle_message(Message::Document(DocumentMessage::CopySelectedLayers)).unwrap();
		editor.handle_message(Message::Document(DocumentMessage::PasteLayers { path: vec![], insert_index: -1 })).unwrap();
		let document_after_copy = editor.dispatcher.document_message_handler.active_document().document.clone();
		let layers_before_copy = document_before_copy.root.as_folder().unwrap().layers();
		let layers_after_copy = document_after_copy.root.as_folder().unwrap().layers();
		assert_eq!(layers_before_copy.len(), 3);
		assert_eq!(layers_after_copy.len(), 4);
		// Existing layers are unaffected
		for i in 0..=2 {
			assert_eq!(layers_before_copy[i], layers_after_copy[i]);
		}
		// The ellipse was copied
		assert_eq!(layers_before_copy[2], layers_after_copy[3]);
	}
fn copy_paste_single_layer ( ) { init_logger ( ) ; let mut editor = create_editor_with_three_layers ( ) ; let document_before_copy = editor . dispatcher . document_message_handler . active_document ( ) . document . clone ( ) ; editor . handle_message ( Message :: Document ( DocumentMessage :: CopySelectedLayers ) ) . unwrap ( ) ; editor . handle_message ( Message :: Document ( DocumentMessage :: PasteLayers { path : vec ! [ ] , insert_index : - 1 } ) ) . unwrap ( ) ; let document_after_copy = editor . dispatcher . document_message_handler . active_document ( ) . document . clone ( ) ; let layers_before_copy = document_before_copy . root . as_folder ( ) . unwrap ( ) . layers ( ) ; let layers_after_copy = document_after_copy . root . as_folder ( ) . unwrap ( ) . layers ( ) ; assert_eq ! ( layers_before_copy len ( ) 3 ) ; assert_eq ! ( layers_after_copy len ( ) 4 ) ; // Existing layers are unaffected for i in 0 ..= 2 { assert_eq ! ( layers_before_copy [ i ] layers_after_copy [ i ] ) ; } // The ellipse was copied assert_eq ! ( layers_before_copy [ 2 ] layers_after_copy [ 3 ] ) ; }
create rect, shape and ellipse
 copy
 paste
 assert that ellipse was copied
create rect shape and ellipse copy paste assert that ellipse was copied