• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

moonbitlang / core / 2722 / 1
96%
main: 96%

Build:
DEFAULT BRANCH: main
Ran 13 Aug 2024 12:56PM UTC
Files 267
Run time 6s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

13 Aug 2024 12:55PM UTC coverage: 86.691% (-0.01%) from 86.701%
2722.1

push

github

web-flow
use for each sugar (#853)

Note Iter::all, Iter::any can also be replaced, but it is not optimal currently
```
pub fn myany [T] (iter/9 : Iter[T], f/10 : (T) -> Bool) -> Bool {
  let *foreach_result/29 : Ref[ForeachResult[Bool, Bool, Unit]] = Ref[
      ForeachResult[Bool, Bool, Unit]
    ]::{
      val: Continue()
    } in
  @ignore(
    iter/9(
      fn (x/11 : T) -> Int {
        @nontail_join fn *foreach_exit/30 (*foreach_body_result/31 : IterResult) -> IterResult {
          *foreach_body_result/31
        }

        if f/10(x/11) {
          *foreach_result/29.val = Break(true)
          *foreach_exit/30(0)
        }
        1
      }
    )
  )
  match *foreach_result/29
  .val {
    Continue => false
    Break as *break/32 => *break/32
    .0
    Return as *return/33 => *return/33
    .0
    Error => panic
  }
}

pub fn myall [T] (iter/6 : Iter[T], f/7 : (T) -> Bool) -> Bool {
  let *foreach_result/36 : Ref[ForeachResult[Bool, Bool, Unit]] = Ref[
      ForeachResult[Bool, Bool, Unit]
    ]::{
      val: Continue()
    } in
  @ignore(
    iter/6(
      fn (x/8 : T) -> Int {
        @nontail_join fn *foreach_exit/37 (*foreach_body_result/38 : IterResult) -> IterResult {
          *foreach_body_result/38
        }

        if !f/7(x/8) {
          *foreach_result/36.val = Break(false)
          *foreach_exit/37(0)
        }
        1
      }
    )
  )
  match *foreach_result/36
  .val {
    Continue => true
    Break as *break/39 => *break/39
    .0
    Return as *return/40 => *return/40
    .0
    Error => panic
  }
}
```

3739 of 4313 relevant lines covered (86.69%)

4553.91 hits per line

Source Files on job 2722.1
  • Tree
  • List 0
  • Changed 8
  • Source Changed 1
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 2722
  • 90795a62 on github
  • Prev Job for on main (#2713.1)
  • Next Job for on main (#2724.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc