Skip to content

Commit

Permalink
Merge branch 'master' into adds-portuguese
Browse files Browse the repository at this point in the history
  • Loading branch information
matrixik committed Feb 23, 2024
2 parents 4d45486 + f701be4 commit d353393
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 52 deletions.
22 changes: 0 additions & 22 deletions .github/workflows/rebase.yml

This file was deleted.

40 changes: 13 additions & 27 deletions .github/workflows/tests.yml
Expand Up @@ -20,51 +20,37 @@ jobs:
matrix:
go-version: [1.18.x, 1.x]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: WillAbides/setup-go-faster@v1
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v4

- uses: actions/cache@v3
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
# In order:
# * Module download cache
# * Build cache (Linux)
# * Build cache (Mac)
# * Build cache (Windows)
path: |
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
%LocalAppData%\go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
go-version: ${{ matrix.go-version }}

- name: Test with race and coverage
run: |
go test -race -coverprofile=coverage.out -covermode=atomic
go tool cover -func=coverage.out
- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v4
with:
files: ./coverage.out
token: ${{ secrets.CODECOV_TOKEN }} # required

lint:
name: "Run static analysis"
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: WillAbides/setup-go-faster@v1
- uses: actions/checkout@v4

- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: "1.x"

- run: "go vet ./..."

- uses: dominikh/staticcheck-action@v1
- name: Staticcheck
uses: dominikh/staticcheck-action@v1.3.0
with:
version: "2022.1.3"
install-go: false
2 changes: 1 addition & 1 deletion languages_substitution.go
Expand Up @@ -260,7 +260,7 @@ var bgSub = map[rune]string{
'Ц': "Ts",
'Ч': "Ch",
'Ш': "Sh",
'Щ': "Sh",
'Щ': "Sht",
'Ъ': "A",
'Ь': "Y",
'Ю': "Yu",
Expand Down
7 changes: 5 additions & 2 deletions slug_test.go
Expand Up @@ -74,8 +74,8 @@ func TestSlugMakeLang(t *testing.T) {
want string
lowercase bool
}{
{"bg", "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЬЮЯабвгдежзийклмнопрстуфхцчшщъьюя", "abvgdezhziyklmnoprstufhtschshshayyuyaabvgdezhziyklmnoprstufhtschshshtayyuya", true},
{"bg", "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЬЮЯабвгдежзийклмнопрстуфхцчшщъьюя", "ABVGDEZhZIYKLMNOPRSTUFHTsChShShAYYuYaabvgdezhziyklmnoprstufhtschshshtayyuya", false},
{"bg", "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЬЮЯабвгдежзийклмнопрстуфхцчшщъьюя", "abvgdezhziyklmnoprstufhtschshshtayyuyaabvgdezhziyklmnoprstufhtschshshtayyuya", true},
{"bg", "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЬЮЯабвгдежзийклмнопрстуфхцчшщъьюя", "ABVGDEZhZIYKLMNOPRSTUFHTsChShShtAYYuYaabvgdezhziyklmnoprstufhtschshshtayyuya", false},
{"cs", "ěščřžýáíéúůóňťĚŠČŘŽÝÁÍÉÚŮÓŇŤ", "escrzyaieuuontescrzyaieuuont", true},
{"cs", "ěščřžýáíéúůóňťĚŠČŘŽÝÁÍÉÚŮÓŇŤ", "escrzyaieuuontESCRZYAIEUUONT", false},
{"ces", "ěščřžýáíéúůóňťĚŠČŘŽÝÁÍÉÚŮÓŇŤ", "escrzyaieuuontescrzyaieuuont", true},
Expand Down Expand Up @@ -204,6 +204,7 @@ func TestSlugMakeUserSubstituteLang(t *testing.T) {
got, smust.want)
}
}
CustomSub = nil
}

func TestSlugMakeSubstituteOrderLang(t *testing.T) {
Expand Down Expand Up @@ -231,6 +232,8 @@ func TestSlugMakeSubstituteOrderLang(t *testing.T) {
got, smsot.want)
}
}
CustomRuneSub = nil
CustomSub = nil
}

func TestSubstituteLang(t *testing.T) {
Expand Down

0 comments on commit d353393

Please sign in to comment.