Skip to content

Commit

Permalink
Use \newline instead of \\ for linebreak (#2)
Browse files Browse the repository at this point in the history
- use \newline latex command instead of \\
- increase version number
- upgrade to Go 1.21
- add token to codecov action
  • Loading branch information
KinNeko-De authored Sep 23, 2023
1 parent dbd7692 commit d4d7de3
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 22 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Install go
uses: actions/setup-go@v3
with:
go-version: '^1.20.0'
go-version: '^1.21.0'
- name: "Installed go version"
run: go version
- name: "Build"
Expand All @@ -26,4 +26,7 @@ jobs:
run: |
go test ./... -race -coverprofile=coverage.out
- name: "Code coverage"
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ on:
workflow_dispatch

env:
MAJOR_MINOR_PATCH: 0.1.0
MAJOR_MINOR_PATCH: 0.2.0
FEATURE_BRANCH_BUILD: 1

concurrency: release-${{ github.ref }}
Expand Down
11 changes: 0 additions & 11 deletions .vscode/settings.json

This file was deleted.

Binary file added documentation/img/repository-open-graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 5 additions & 6 deletions encoding/protolua/encode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,14 +229,14 @@ func TestMarshal_Positive(t *testing.T) {
input: &v3proto.SingleString{
Fut: "\n",
},
expected: "SingleString={fut=\"\\\\\\\\\"}",
expected: "SingleString={fut=\" \\\\newline \"}",
},
{
desc: "Message with special character carriage return and line feed",
input: &v3proto.SingleString{
Fut: "\r\n",
},
expected: "SingleString={fut=\"\\\\\\\\\"}",
expected: "SingleString={fut=\" \\\\newline \"}",
},
{
desc: "Message with special character \\",
Expand Down Expand Up @@ -362,7 +362,7 @@ func TestMarshal_GoogleProtobuf_CanBeOverridden(t *testing.T) {

actual, err := LuaMarshalOption{AdditionalMarshalers: []interface {
Handle(fullName protoreflect.FullName) (MarshalFunc, error)
}{ &TestOverrider{}}}.marshal(message)
}{&TestOverrider{}}}.marshal(message)

AssertLuaString(actual, err, expected, t)
}
Expand All @@ -387,8 +387,8 @@ func (TestOverrider) Handle(fullName protoreflect.FullName) (MarshalFunc, error)

convertTimestamp := func(encodingRun EncodingRun, m protoreflect.Message) error {
err := encodingRun.Encoder.WriteString("FortyTwo")
if(err != nil) {
return err;
if err != nil {
return err
}
return nil
}
Expand All @@ -403,4 +403,3 @@ func (TestOverrider) Handle(fullName protoreflect.FullName) (MarshalFunc, error)
}
return nil, nil
}

2 changes: 1 addition & 1 deletion encoding/protolua/encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func appendString(out []byte, in string) ([]byte, error) {
case '\f':
return out, errors.New("not implemented yet")
case '\n': // replaced with a latex line break that needs to be escaped
out = append(out, "\\\\\\\\"...)
out = append(out, " \\\\newline "...)
case '\r':
// do nothing as \r\n and \n are reduced to line break
case '\t':
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/kinneko-de/protobuf-go

go 1.20
go 1.21

require (
github.com/google/go-cmp v0.5.9
Expand Down

0 comments on commit d4d7de3

Please sign in to comment.