Skip to content

Commit

Permalink
test: Experimental change
Browse files Browse the repository at this point in the history
  • Loading branch information
marinojoey committed Sep 1, 2023
1 parent 82573a3 commit 1b8f6f3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/scales/__tests__/saxon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,11 @@ describe('SAXON', () => {
expect(isValid).toBe(false)
})
})

describe('getScore', () => {
test('should handle grade format with slash "7a/7b"', () => {
const score = SaxonScale.getScore('7a/7b')
expect(score).not.toEqual(-1)
})
})
})
2 changes: 1 addition & 1 deletion src/scales/saxon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import routes from '../data/routes.json'
import { Route } from '.'
import { GradeBandTypes, routeScoreToBand } from '../GradeBands'

const saxonGradeRegex = /^((([7-9]|1[0-3])([a-c]))|([1-6]))$/i
const saxonGradeRegex = /^((([7-9]|1[0-3])([a-c]))|([1-6])|([7-9]|1[0-3])(([a-c])\/([7-9]|1[0-3])([a-c])))$/i
// Saxon grading system, predominant in Central Europe (esp. Germany, Austria, Switzerland)
// Supports 1 -> 13c, slash grades i.e. 7a/7b
// Uses Arabic numerals with letters from a-c, e.g. "7a" , "7b", or "7c" (hardest)
Expand Down

0 comments on commit 1b8f6f3

Please sign in to comment.