Skip to content

Commit

Permalink
update FSRS-rs to 1.3.3 (#28)
Browse files Browse the repository at this point in the history
Co-authored-by: Alex <[email protected]>
  • Loading branch information
L-M-Sherlock and AlexErrant authored Oct 18, 2024
1 parent dd7df69 commit 39f5555
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
14 changes: 13 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion fsrs-rs
9 changes: 6 additions & 3 deletions sandbox/tests/prod.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { test, expect, Page } from '@playwright/test'
import { test, expect } from '@playwright/test'
import { goHome } from './util'

test('check memory state', async ({ page }) => {
Expand All @@ -22,13 +22,16 @@ test('check memory state', async ({ page }) => {
test('check next interval', async ({ page }) => {
await goHome(page)
await page.getByRole('button', { name: 'Calculate Next Interval' }).click()
await expect(page.locator('#nextIntervalResponse')).toHaveText('2')
await expect(page.locator('#nextIntervalResponse')).toContainText('.') // ensures that text has updated, so the more specific assertion `.toEqual(2)` can run
const nextInterval = await page.locator('#nextIntervalResponse').textContent()
const rounded = Math.round(parseFloat(nextInterval))
expect(rounded).toEqual(2)
})

test('check progress and parameters', async ({ page }) => {
await goHome(page)
await page.getByRole('button', { name: 'Train with example file' }).click()
let progress = await page.locator('#progressNumbers').innerText()
const progress = await page.locator('#progressNumbers').innerText()
expect(progress).toEqual('0/0')
await expect
.poll(
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ impl FSRSwasm {
stability: Option<f32>,
desired_retention: f32,
rating: u32,
) -> u32 {
) -> f32 {
self.model
.next_interval(stability, desired_retention, rating)
}
Expand Down

0 comments on commit 39f5555

Please sign in to comment.