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

Fix slice #72

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
Next Next commit
Add Unicode tests for slice filter
These tests currently pass, so I'm committing them alone

I intend on changing the implementation and need to ensure they stay
green.
  • Loading branch information
ofavre committed Sep 16, 2022
commit f0de286173e29cb80d5e23e9552ff3a3743ff935
5 changes: 5 additions & 0 deletions filters/standard_filters_test.go
Original file line number Diff line number Diff line change
@@ -101,6 +101,11 @@ var filterTests = []struct {
{`"Liquid" | slice: 2`, "q"},
{`"Liquid" | slice: 2, 5`, "quid"},
{`"Liquid" | slice: -3, 2`, "ui"},
{`"白鵬翔" | slice: 0`, "白"},
{`"白鵬翔" | slice: 1`, "鵬"},
{`"白鵬翔" | slice: 2`, "翔"},
{`"白鵬翔" | slice: 0, 2`, "白鵬"},
{`"白鵬翔" | slice: 1, 2`, "鵬翔"},

{`"a/b/c" | split: '/' | join: '-'`, "a-b-c"},
{`"a/b/" | split: '/' | join: '-'`, "a-b"},