Skip to content

Commit 4d6fa22

Browse files
test: Turtle.ArcRight length test ( re #131 )
1 parent de58edb commit 4d6fa22

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Turtle.tests.ps1

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,26 @@ describe Turtle {
1919
$png[1..3] -as 'char[]' -as 'string[]' -join '' | Should -Be PNG
2020
}
2121

22+
it 'Can draw an arc' {
23+
$Radius = 1
24+
$t = turtle ArcRight $Radius 360
25+
$Heading = 180.0
26+
[Math]::Round($t.Width,1) | Should -Be ($Radius * 2)
27+
[Math]::Round($t.Heading,1) | Should -Be 360.0
28+
29+
$Radius = 1
30+
$Heading = 180.0
31+
$t = turtle ArcRight $Radius 180
32+
[Math]::Round($t.Width,1) | Should -Be ($Radius * 2)
33+
[Math]::Round($t.Heading,1) | Should -Be $Heading
34+
35+
$Radius = 1
36+
$Heading = 90.0
37+
$t = turtle ArcRight $Radius $Heading
38+
[Math]::Round($t.Width,1) | Should -Be ($Radius * 4)
39+
[Math]::Round($t.Heading,1) | Should -Be $Heading
40+
}
41+
2242

2343
context 'Turtle Directions' {
2444
it 'Can tell you the way towards a point' {

0 commit comments

Comments
 (0)