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

moonbitlang / core / 2722
97%

Build:
DEFAULT BRANCH: main
Ran 13 Aug 2024 12:56PM UTC
Jobs 1
Files 266
Run time 1min
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.839% (-0.009%) from 86.848%
2722

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
  }
}
```

1 of 1 new or added line in 1 file covered. (100.0%)

3728 of 4293 relevant lines covered (86.84%)

4575.13 hits per line

Jobs
ID Job ID Ran Files Coverage
1 2722.1 13 Aug 2024 12:56PM UTC 0
86.69
GitHub Action Run
Source Files on build 2722
Detailed source file information is not available for this build.
  • Back to Repo
  • 90795a62 on github
  • Prev Build on main (#2713)
  • Next Build on main (#2724)
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