Skip to content

Commit

Permalink
[prakriya] Add test and fixes for Unadi 1.1
Browse files Browse the repository at this point in the history
Tested in my local system
  • Loading branch information
yashkhasbage25 authored and akprasad committed Apr 16, 2023
1 parent 9b5e4f6 commit 7ddaafe
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
9 changes: 1 addition & 8 deletions vidyut-prakriya/src/krt/unadi_sutras.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,7 @@ pub fn try_add_unadi(p: &mut Prakriya, krt: Krt) -> Option<bool> {
match krt {
K::uR => {
if dhatu.has_u_in(&[
"qukf\\Y",
"vA\\",
"pA\\",
"ji\\",
"qu\\mi\\Y",
"zvada~",
"sA\\Da~",
"aSU~\\",
"qukf\\Y", "vA\\", "pA\\", "ji\\", "qumi\\Y", "zvada~\\", "sA\\Da~", "aSU~\\",
]) {
wrap.try_add(Unadi("1.1"), krt);
}
Expand Down
12 changes: 12 additions & 0 deletions vidyut-prakriya/tests/unadi_sutras.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ fn d(u: &str, g: Gana) -> Dhatu {
Dhatu::new(u, g)
}

#[test]
fn sutra_1_1() {
assert_has_krdanta(&[], &d("qukf\\Y", Tanadi), Krt::uR, &["kAru"]);
assert_has_krdanta(&[], &d("pA\\", Bhvadi), Krt::uR, &["pAyu"]);
assert_has_krdanta(&[], &d("vA\\", Adadi), Krt::uR, &["vAyu"]);
assert_has_krdanta(&[], &d("ji\\", Bhvadi), Krt::uR, &["jAyu"]);
assert_has_krdanta(&[], &d("qumi\\Y", Svadi), Krt::uR, &["mAyu"]);
assert_has_krdanta(&[], &d("zvada~\\", Bhvadi), Krt::uR, &["svAdu"]);
assert_has_krdanta(&[], &d("sA\\Da~", Svadi), Krt::uR, &["sADu"]);
assert_has_krdanta(&[], &d("aSU~\\", Svadi), Krt::uR, &["ASu"]);
}

#[ignore]
#[test]
fn sutra_1_5() {
Expand Down

0 comments on commit 7ddaafe

Please sign in to comment.