Skip to content

Commit 55de2b2

Browse files
committed
bless insta tests for crates/codegen
1 parent cbaacf1 commit 55de2b2

3 files changed

Lines changed: 58 additions & 0 deletions

File tree

crates/codegen/tests/snapshots/codegen__codegen_csharp.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ expression: outfiles
44
---
55
"Procedures/ReturnValue.g.cs" = ''
66
"Procedures/SleepOneSecond.g.cs" = ''
7+
"Procedures/WithTx.g.cs" = ''
78
"Reducers/Add.g.cs" = '''
89
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
910
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.

crates/codegen/tests/snapshots/codegen__codegen_rust.snap

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,6 +1423,7 @@ pub mod test_e_table;
14231423
pub mod test_f_table;
14241424
pub mod return_value_procedure;
14251425
pub mod sleep_one_second_procedure;
1426+
pub mod with_tx_procedure;
14261427

14271428
pub use baz_type::Baz;
14281429
pub use foobar_type::Foobar;
@@ -1468,6 +1469,7 @@ pub use test_reducer::{test, set_flags_for_test, TestCallbackId};
14681469
pub use test_btree_index_args_reducer::{test_btree_index_args, set_flags_for_test_btree_index_args, TestBtreeIndexArgsCallbackId};
14691470
pub use return_value_procedure::return_value;
14701471
pub use sleep_one_second_procedure::sleep_one_second;
1472+
pub use with_tx_procedure::with_tx;
14711473

14721474
#[derive(Clone, PartialEq, Debug)]
14731475

@@ -4851,3 +4853,57 @@ impl set_flags_for_test for super::SetReducerFlags {
48514853
}
48524854

48534855
'''
4856+
"with_tx_procedure.rs" = '''
4857+
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
4858+
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
4859+
4860+
#![allow(unused, clippy::all)]
4861+
use spacetimedb_sdk::__codegen::{
4862+
self as __sdk,
4863+
__lib,
4864+
__sats,
4865+
__ws,
4866+
};
4867+
4868+
4869+
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
4870+
#[sats(crate = __lib)]
4871+
struct WithTxArgs {
4872+
}
4873+
4874+
4875+
impl __sdk::InModule for WithTxArgs {
4876+
type Module = super::RemoteModule;
4877+
}
4878+
4879+
#[allow(non_camel_case_types)]
4880+
/// Extension trait for access to the procedure `with_tx`.
4881+
///
4882+
/// Implemented for [`super::RemoteProcedures`].
4883+
pub trait with_tx {
4884+
fn with_tx(&self, ) {
4885+
self.with_tx_then( |_, _| {});
4886+
}
4887+
4888+
fn with_tx_then(
4889+
&self,
4890+
4891+
__callback: impl FnOnce(&super::ProcedureEventContext, Result<(), __sdk::InternalError>) + Send + 'static,
4892+
);
4893+
}
4894+
4895+
impl with_tx for super::RemoteProcedures {
4896+
fn with_tx_then(
4897+
&self,
4898+
4899+
__callback: impl FnOnce(&super::ProcedureEventContext, Result<(), __sdk::InternalError>) + Send + 'static,
4900+
) {
4901+
self.imp.invoke_procedure_with_callback::<_, ()>(
4902+
"with_tx",
4903+
WithTxArgs { },
4904+
__callback,
4905+
);
4906+
}
4907+
}
4908+
4909+
'''

crates/codegen/tests/snapshots/codegen__codegen_typescript.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4146,3 +4146,4 @@ export const Test = {
41464146
export default Test;
41474147

41484148
'''
4149+
"with_tx_procedure.ts" = ''

0 commit comments

Comments
 (0)