Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Special chars bindings unit tests #3485

Merged
merged 3 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions v2/internal/binding/binding_test/binding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func TestBindings_GenerateModels(t *testing.T) {
AnonymousSubStructMultiLevelTest,
GeneratedJsEntityWithNestedStructTest,
EntityWithDiffNamespaces,
SpecialCharacterFieldTest,
}

testLogger := &logger.Logger{}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package binding_test

type SpecialCharacterField struct {
ID string `json:"@ID,omitempty"`
}

func (s SpecialCharacterField) Get() SpecialCharacterField {
return s
}

var SpecialCharacterFieldTest = BindingTest{
name: "SpecialCharacterField",
structs: []interface{}{
&SpecialCharacterField{},
},
exemptions: nil,
shouldError: false,
want: `
export namespace binding_test {
export class SpecialCharacterField {
"@ID"?: string;
static createFrom(source: any = {}) {
return new SpecialCharacterField(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this["@ID"] = source["@ID"];
}
}
}
`,
}
1 change: 1 addition & 0 deletions website/src/pages/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added
- Support for compiling with `libwebkit2gtk-4.1` instead of `4.0` to support latest Ubuntu release by [atterpac](https://github.com/atterpac) in [#3465](https://github.com/wailsapp/wails/pull/3465)
- Unit test for fix [#3476](https://github.com/wailsapp/wails/pull/3476) by [gjergj](https://github.com/Gjergj) in [#3485](https://github.com/wailsapp/wails/pull/3485)

### Changed
- Updated several broken links in the "How Does It Work?" page on the website. Changed by [@oguz-yilmaz](https://github.com/oguz-yilmaz) in [PR #3469](https://github.com/wailsapp/wails/pull/3469)
Expand Down
Loading