diff options
| author | Zalathar <Zalathar@users.noreply.github.com> | 2023-06-12 18:07:04 +1000 |
|---|---|---|
| committer | Zalathar <Zalathar@users.noreply.github.com> | 2023-06-28 11:09:19 +1000 |
| commit | e0625b4586c5a0f855a1157b09ae384f5de0ecf7 (patch) | |
| tree | d6f6d80e1d6b9aaec8b6340986a3e22475775651 /tests/run-coverage/nested_loops.coverage | |
| parent | 22e119bbacd3aa11db04d84947b4fb2c5ccb0435 (diff) | |
| download | rust-e0625b4586c5a0f855a1157b09ae384f5de0ecf7.tar.gz rust-e0625b4586c5a0f855a1157b09ae384f5de0ecf7.zip | |
Migrate most of the existing coverage tests over to `run-coverage`
Diffstat (limited to 'tests/run-coverage/nested_loops.coverage')
| -rw-r--r-- | tests/run-coverage/nested_loops.coverage | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/run-coverage/nested_loops.coverage b/tests/run-coverage/nested_loops.coverage new file mode 100644 index 00000000000..0dbd6bcf313 --- /dev/null +++ b/tests/run-coverage/nested_loops.coverage @@ -0,0 +1,26 @@ + 1| 1|fn main() { + 2| 1| let is_true = std::env::args().len() == 1; + 3| 1| let mut countdown = 10; + 4| | + 5| 1| 'outer: while countdown > 0 { + 6| 1| let mut a = 100; + 7| 1| let mut b = 100; + 8| 3| for _ in 0..50 { + 9| 3| if a < 30 { + 10| 0| break; + 11| 3| } + 12| 3| a -= 5; + 13| 3| b -= 5; + 14| 3| if b < 90 { + 15| 1| a -= 10; + 16| 1| if is_true { + 17| 1| break 'outer; + 18| 0| } else { + 19| 0| a -= 2; + 20| 0| } + 21| 2| } + 22| | } + 23| 0| countdown -= 1; + 24| | } + 25| 1|} + |
