@@ -12,31 +12,41 @@ void coordinateChangeDoesNotProduceRotationHistory() {
1212 var before = source (7.5 , -59.5 , 5.5 , 220.2f , 0 );
1313 var after = source (-4.73 , -60 , 11.77 , 220.2f , 0 );
1414 assertEquals ("X -4.73 / Y -60.00 / Z 11.77" , SourceDetailsFormatting .position (after ));
15- assertEquals ("yaw 220.2° / pitch 0.0°" , SourceDetailsFormatting .rotation (after ));
16- assertEquals ("" , SourceDetailsFormatting .previousRotation (before , after ));
15+ assertEquals ("yaw 220.2° / pitch 0.0°" , SourceDetailsFormatting .rotation (after , "yaw" , "pitch" ));
16+ assertEquals ("" , SourceDetailsFormatting .previousRotation (before , after , "yaw" , "pitch" ));
1717 assertEquals ("← X 7.50 / Y -59.50 / Z 5.50" , SourceDetailsFormatting .previousPosition (before , after ));
1818 }
1919
2020 @ Test
2121 void eachAxisAndAngleIsComparedIndependently () {
2222 var before = source (1 , 2 , 3 , 45 , -10 );
2323 assertEquals ("← X - / Y 2.00 / Z -" , SourceDetailsFormatting .previousPosition (before , source (1 , 4 , 3 , 45 , -10 )));
24- assertEquals ("← yaw - / pitch -10.0°" , SourceDetailsFormatting .previousRotation (before , source (1 , 2 , 3 , 45 , 0 )));
24+ assertEquals ("← yaw - / pitch -10.0°" , SourceDetailsFormatting .previousRotation (before , source (1 , 2 , 3 , 45 , 0 ), "yaw" , "pitch" ));
2525 assertEquals ("" , SourceDetailsFormatting .previousPosition (before , source (1 , 2 , 3 , 90 , 0 )));
26- assertEquals ("← yaw 45.0° / pitch -10.0°" , SourceDetailsFormatting .previousRotation (before , source (1 , 2 , 3 , 90 , 0 )));
26+ assertEquals ("← yaw 45.0° / pitch -10.0°" , SourceDetailsFormatting .previousRotation (before , source (1 , 2 , 3 , 90 , 0 ), "yaw" , "pitch" ));
2727 }
2828
2929 @ Test
3030 void missingParentOrUnchangedTransformDoesNotProduceHistoryRow () {
3131 var source = source (1 , 2 , 3 , 45 , -10 );
3232 assertEquals ("" , SourceDetailsFormatting .previousPosition (null , source ));
33- assertEquals ("" , SourceDetailsFormatting .previousRotation (null , source ));
34- assertEquals ("" , SourceDetailsFormatting .previousRotation (source , source ));
33+ assertEquals ("" , SourceDetailsFormatting .previousRotation (null , source , "yaw" , "pitch" ));
34+ assertEquals ("" , SourceDetailsFormatting .previousRotation (source , source , "yaw" , "pitch" ));
3535 assertEquals ("" , SourceDetailsFormatting .previousPosition (source , source ));
3636 var otherDimension = new PauseSource (source .anchor (), source .pitch (), source .yaw (), null , "minecraft:the_nether" );
3737 assertEquals ("" , SourceDetailsFormatting .previousPosition (source , otherDimension ));
3838 }
3939
40+ @ Test
41+ void localizedAnglesPreserveValuesAndIndependentHistory () {
42+ var before = source (1 , 2 , 3 , 45 , -10 );
43+ var after = source (1 , 2 , 3 , 45 , 0 );
44+ assertEquals ("수평각 45.0° / 수직각 0.0°" , SourceDetailsFormatting .rotation (after , "수평각" , "수직각" ));
45+ assertEquals ("← 수평각 - / 수직각 -10.0°" ,
46+ SourceDetailsFormatting .previousRotation (before , after , "수평각" , "수직각" ));
47+ assertEquals ("" , SourceDetailsFormatting .previousRotation (null , after , "수평각" , "수직각" ));
48+ }
49+
4050 private static PauseSource source (double x , double y , double z , float yaw , float pitch ) {
4151 return new PauseSource (new Vec3d (x , y , z ), pitch , yaw , null , "minecraft:overworld" );
4252 }
0 commit comments