(t *testing.T)
| 805 | } |
| 806 | |
| 807 | func TestLoopRelations(t *testing.T) { |
| 808 | // this loop is used in the regression test cases below. |
| 809 | containingLoop := LoopFromPoints([]Point{ |
| 810 | PointFromLatLng(LatLngFromDegrees(-38.0, -135.0)), |
| 811 | PointFromLatLng(LatLngFromDegrees(-38.0, 149.0)), |
| 812 | PointFromLatLng(LatLngFromDegrees(77.0, 149.0)), |
| 813 | PointFromLatLng(LatLngFromDegrees(77.0, -135.0)), |
| 814 | }) |
| 815 | |
| 816 | innerTile := LoopFromPoints([]Point{ |
| 817 | PointFromLatLng(LatLngFromDegrees(37.99616267972809, 13.007812500000002)), |
| 818 | PointFromLatLng(LatLngFromDegrees(37.99616267972809, 13.359375000000002)), |
| 819 | PointFromLatLng(LatLngFromDegrees(38.272819658516866, 13.359375000000002)), |
| 820 | PointFromLatLng(LatLngFromDegrees(38.272819658516866, 13.007812500000002)), |
| 821 | }) |
| 822 | |
| 823 | // +0.2 lat +0.2 lon from innerTile |
| 824 | extendedTile := LoopFromPoints([]Point{ |
| 825 | PointFromLatLng(LatLngFromDegrees(37.99616267972809, 13.007812500000002)), |
| 826 | PointFromLatLng(LatLngFromDegrees(37.99616267972809, 13.559375000000002)), |
| 827 | PointFromLatLng(LatLngFromDegrees(38.472819658516866, 13.559375000000002)), |
| 828 | PointFromLatLng(LatLngFromDegrees(38.472819658516866, 13.007812500000002)), |
| 829 | }) |
| 830 | |
| 831 | tests := []struct { |
| 832 | a, b *Loop |
| 833 | contains bool // A contains B |
| 834 | contained bool // B contains A |
| 835 | disjoint bool // A and B are disjoint (intersection is empty) |
| 836 | covers bool // (A union B) covers the entire sphere |
| 837 | sharedEdge bool // the loops share at least one edge (possibly reversed) |
| 838 | }{ |
| 839 | // Check full and empty relationships with normal loops and each other. |
| 840 | { |
| 841 | a: FullLoop(), |
| 842 | b: FullLoop(), |
| 843 | contains: true, |
| 844 | contained: true, |
| 845 | covers: true, |
| 846 | sharedEdge: true, |
| 847 | }, |
| 848 | { |
| 849 | a: FullLoop(), |
| 850 | b: northHemi, |
| 851 | contains: true, |
| 852 | covers: true, |
| 853 | sharedEdge: false, |
| 854 | }, |
| 855 | { |
| 856 | a: FullLoop(), |
| 857 | b: EmptyLoop(), |
| 858 | contains: true, |
| 859 | disjoint: true, |
| 860 | covers: true, |
| 861 | sharedEdge: false, |
| 862 | }, |
| 863 | { |
| 864 | a: northHemi, |
nothing calls this directly
no test coverage detected
searching dependent graphs…