Skip to content

proptest 추가#7

Merged
owjs3901 merged 2 commits into
dev-five-git:mainfrom
youknowone:proptest
Jun 12, 2025
Merged

proptest 추가#7
owjs3901 merged 2 commits into
dev-five-git:mainfrom
youknowone:proptest

Conversation

@youknowone
Copy link
Copy Markdown
Contributor

encode/decode가 둘다 있는줄 알고 roundtrip 테스트를 만들려고 했는데요.
나중에 decode가 붙으면 decode 까지 테스트할수 있게 남겨두었습니다

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 12, 2025

⚠️ No Changeset found

Latest commit: 790f25d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Comment thread libs/braillify/Cargo.toml Outdated
[dev-dependencies]
csv = "1.3.0"
serde_json = "^1"
proptest = "1.5"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

찾아보니 proptest의 경우 1.7.0이 최신 버전이니 1.5에서 1.7 으로 변경하면 어떨까 합니다.

Comment on lines +116 to +148
proptest! {
#[test]
fn test_char_type_proptest(c: char) {
let result = CharType::new(c);
match result {
Ok(char_type) => {
match char_type {
CharType::Korean(korean_char) => {
assert!(korean_char.cho != '\0');
assert!(korean_char.jung != '\0');
}
CharType::KoreanPart(ch) => {
let code = ch as u32;
assert!(0x3131 <= code && code <= 0x3163);
}
CharType::English(ch) => {
assert!(ch.is_ascii_alphabetic());
}
CharType::Number(ch) => {
assert!(ch.is_ascii_digit());
}
CharType::Symbol(ch) => {
assert!(is_symbol_char(ch));
}
CharType::MathSymbol(ch) => {
assert!(is_math_symbol_char(ch));
}
CharType::Space(ch) => {
assert!(ch.is_whitespace());
}
}
}
Err(_) => {

}
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

제가 잘 몰라서 그런데 proptest 와 같이 작성될 경우 무작위의 값이 들어가는 건가요?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네 맞습니다. 임의의 값을 넣어서 여러 번 호출해 주기 때문에, 입력 범위에 대해 랜덤샘플링으로 테스트하는 효과를 냅니다

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
libs/braillify/src/char_struct.rs 96.87% <ø> (+3.12%) ⬆️
libs/braillify/src/lib.rs 92.98% <ø> (+1.07%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@owjs3901 owjs3901 merged commit 1405151 into dev-five-git:main Jun 12, 2025
2 checks passed
@youknowone youknowone deleted the proptest branch June 12, 2025 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants