diff --git a/v2/internal/binding/binding_test/binding_test.go b/v2/internal/binding/binding_test/binding_test.go index 6d643b92d5a..947c3b08a0a 100644 --- a/v2/internal/binding/binding_test/binding_test.go +++ b/v2/internal/binding/binding_test/binding_test.go @@ -48,6 +48,7 @@ func TestBindings_GenerateModels(t *testing.T) { AnonymousSubStructMultiLevelTest, GeneratedJsEntityWithNestedStructTest, EntityWithDiffNamespaces, + SpecialCharacterFieldTest, } testLogger := &logger.Logger{} diff --git a/v2/internal/binding/binding_test/binding_variablespecialcharacter_test.go b/v2/internal/binding/binding_test/binding_variablespecialcharacter_test.go new file mode 100644 index 00000000000..7dbe723509f --- /dev/null +++ b/v2/internal/binding/binding_test/binding_variablespecialcharacter_test.go @@ -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"]; + } + } +} +`, +} diff --git a/website/src/pages/changelog.mdx b/website/src/pages/changelog.mdx index facd68f3991..58a63d83745 100644 --- a/website/src/pages/changelog.mdx +++ b/website/src/pages/changelog.mdx @@ -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)