-
Notifications
You must be signed in to change notification settings - Fork 0
fix(input): restrict interactive binary choices to 1 or 2 #325
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
base: master
Are you sure you want to change the base?
Changes from 2 commits
0c88908
e31ed6e
d1732bb
f3da093
ed9f9c5
190f8d5
14767a8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,3 +24,8 @@ | |
| ^\.jules(/.*)?$ | ||
| ^\.trivyignore\.yaml$ | ||
| ^trivy\.yaml$ | ||
| ^tests/testthat/test-sentinel-integer-coercion\.R$ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win 회귀 테스트를 소스 패키지에서 제외하지 마십시오. Line 27은 As per coding guidelines, “Add tests/fixtures first when behavior changes are required.” 🤖 Prompt for AI AgentsSource: Coding guidelines |
||
| ^\.semgrepignore$ | ||
| ^test_dummy\.R$ | ||
| ^test_validation\.R$ | ||
| ^\.markdownlint\.json$ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| test_that("interactive readline valid inputs", { | ||
| # For valid inputs, it should correctly parse the '1' and eventually hit the estimation | ||
| # We test the prompt reading by providing minimal data that causes mirt to fail early | ||
| # but after the prompt logic. | ||
|
|
||
| mock_readline_confirm <- mockery::mock('1') | ||
| mockery::stub(aFIPC::autoFIPC, 'interactive', TRUE) | ||
| mockery::stub(aFIPC::autoFIPC, 'readline', mock_readline_confirm) | ||
|
|
||
| # A 100x4 matrix works better to avoid degrees of freedom errors in some cases, | ||
| # but our goal is just to pass the `checkCorrect()` prompt logic. | ||
| expect_error( | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 성공 경로를 명시적으로 검증하십시오. Line 12의 🤖 Prompt for AI AgentsSource: Coding guidelines |
||
| aFIPC::autoFIPC( | ||
| newformXData = matrix(sample(c(0,1), 1000, replace=T), ncol=10, dimnames=list(NULL, paste0('I',1:10))), | ||
| oldformYData = matrix(sample(c(0,1), 1000, replace=T), ncol=10, dimnames=list(NULL, paste0('I',1:10))), | ||
| newformCommonItemNames = 'I1', | ||
| oldformCommonItemNames = 'I1', | ||
| itemtype = '3PL', | ||
| newformBILOGprior = TRUE, | ||
| oldformBILOGprior = TRUE, | ||
| confirmCommonItems = NULL | ||
| ) | ||
| ) | ||
|
Comment on lines
+12
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| }) | ||
|
|
||
| test_that("interactive readline invalid inputs", { | ||
| # Mock invalid inputs | ||
| mock_readline_invalid <- mockery::mock('3', 'a', '9999999999999999999999999999999', cycle = TRUE) | ||
| mockery::stub(aFIPC::autoFIPC, 'interactive', TRUE) | ||
| mockery::stub(aFIPC::autoFIPC, 'readline', mock_readline_invalid) | ||
|
|
||
| expect_error( | ||
| aFIPC::autoFIPC( | ||
| newformXData = matrix(sample(c(0,1), 1000, replace=T), ncol=10, dimnames=list(NULL, paste0('I',1:10))), | ||
| oldformYData = matrix(sample(c(0,1), 1000, replace=T), ncol=10, dimnames=list(NULL, paste0('I',1:10))), | ||
| newformCommonItemNames = 'I1', | ||
| oldformCommonItemNames = 'I1', | ||
| itemtype = '3PL', | ||
| newformBILOGprior = NULL, | ||
| oldformBILOGprior = TRUE, | ||
| confirmCommonItems = TRUE | ||
| ), | ||
| "Too many invalid newform BILOG prior attempts" | ||
| ) | ||
|
|
||
| expect_error( | ||
| aFIPC::autoFIPC( | ||
| newformXData = matrix(sample(c(0,1), 1000, replace=T), ncol=10, dimnames=list(NULL, paste0('I',1:10))), | ||
| oldformYData = matrix(sample(c(0,1), 1000, replace=T), ncol=10, dimnames=list(NULL, paste0('I',1:10))), | ||
| newformCommonItemNames = 'I1', | ||
| oldformCommonItemNames = 'I1', | ||
| itemtype = '3PL', | ||
| newformBILOGprior = TRUE, | ||
| oldformBILOGprior = NULL, | ||
| confirmCommonItems = TRUE | ||
| ), | ||
| "Too many invalid oldform BILOG prior attempts" | ||
| ) | ||
|
|
||
| expect_error( | ||
| aFIPC::autoFIPC( | ||
| newformXData = matrix(sample(c(0,1), 1000, replace=T), ncol=10, dimnames=list(NULL, paste0('I',1:10))), | ||
| oldformYData = matrix(sample(c(0,1), 1000, replace=T), ncol=10, dimnames=list(NULL, paste0('I',1:10))), | ||
| newformCommonItemNames = 'I1', | ||
| oldformCommonItemNames = 'I1', | ||
| itemtype = '3PL', | ||
| newformBILOGprior = TRUE, | ||
| oldformBILOGprior = TRUE, | ||
| confirmCommonItems = NULL | ||
| ), | ||
| "Too many invalid common item confirmation attempts" | ||
| ) | ||
| }) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔍 Regression tests bypass package checks
This exclusion removes the new tests from the source package used by
R CMD check. CI therefore provides no built-package regression coverage.Was this helpful? React with 👍 or 👎 to provide feedback.