hyf

Context-aware query service for Radroots
git clone https://radroots.dev/git/hyf.git
Log | Files | Refs | README | LICENSE

guard_seed.mojo (933B)


      1 # Deliberately faulty guard implementations used to prove that critical tests
      2 # actually catch representative regressions.
      3 from std.collections import List
      4 
      5 
      6 def correct_eligibility(has_fail: Bool, has_unknown: Bool) -> String:
      7     if has_fail:
      8         return "ineligible"
      9     if has_unknown:
     10         return "conditional"
     11     return "eligible"
     12 
     13 
     14 def seeded_unknown_to_pass(has_fail: Bool, has_unknown: Bool) -> String:
     15     if has_fail:
     16         return "ineligible"
     17     return "eligible"
     18 
     19 
     20 def correct_compare(left: Int, right: Int) -> Int:
     21     if left < right:
     22         return -1
     23     if left > right:
     24         return 1
     25     return 0
     26 
     27 
     28 def seeded_comparison_inversion(left: Int, right: Int) -> Int:
     29     return correct_compare(right, left)
     30 
     31 
     32 def correct_revision_check(expected: String, current: String) -> Bool:
     33     return expected == current
     34 
     35 
     36 def seeded_revision_check_bypass(expected: String, current: String) -> Bool:
     37     return True