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

update FSRS-rs to 1.3.3 #28

Merged
merged 3 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
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
Loading