Skip to content

Commit

Permalink
Add test for generating constants
Browse files Browse the repository at this point in the history
  • Loading branch information
edif2008 committed Dec 23, 2024
1 parent dec632b commit c46fb3c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/data/tests/can_generate_const/input.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#[typeshare]
pub const MY_VAR: u32 = 12;
5 changes: 5 additions & 0 deletions core/data/tests/can_generate_const/output.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package proto

import "encoding/json"

const MyVar uint32 = 12;
6 changes: 6 additions & 0 deletions core/data/tests/can_generate_const/output.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from __future__ import annotations




MY_VAR: int = 12
1 change: 1 addition & 0 deletions core/data/tests/can_generate_const/output.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const MY_VAR: number = 12;
1 change: 1 addition & 0 deletions core/tests/snapshot_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ tests! {
scala,
typescript
];
can_generate_const: [typescript, go, python];
can_generate_slice_of_user_type: [swift, kotlin, scala, typescript, go, python];
can_generate_readonly_fields: [
typescript
Expand Down

0 comments on commit c46fb3c

Please sign in to comment.