Changeset 17158 in josm for trunk


Ignore:
Timestamp:
2020-10-11T10:30:11+02:00 (4 years ago)
Author:
simon04
Message:

see #19370 - Fix OsmReaderTest on Windows (byte counting due to line separator)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/io/OsmReaderTest.java

    r16642 r17158  
    22package org.openstreetmap.josm.io;
    33
     4import static org.hamcrest.CoreMatchers.anyOf;
     5import static org.hamcrest.CoreMatchers.is;
     6import static org.hamcrest.MatcherAssert.assertThat;
    47import static org.junit.Assert.assertEquals;
    58import static org.junit.Assert.assertFalse;
     
    345348            fail("should throw exception");
    346349        } catch (IllegalDataException e) {
    347             assertEquals("Illegal value for attributes 'lat', 'lon' on node with ID 1425146006." +
    348                     " Got '550.3311950157', '10.49428298298'." +
    349                     " (at line 5, column 179). 578 bytes have been read", e.getMessage());
     350            String prefix = "Illegal value for attributes 'lat', 'lon' on node with ID 1425146006. Got '550.3311950157', '10.49428298298'.";
     351            assertThat(e.getMessage(), anyOf(
     352                    is(prefix + " (at line 5, column 179). 578 bytes have been read"),
     353                    is(prefix + " (at line 5, column 179). 581 bytes have been read") // GitHub Actions
     354            ));
    350355        }
    351356    }
     
    361366            fail("should throw exception");
    362367        } catch (IllegalDataException e) {
    363             assertEquals("Illegal value for attributes 'lat', 'lon' on node with ID 978." +
    364                     " Got 'nan', 'nan'." +
    365                     " (at line 4, column 151). 336 bytes have been read", e.getMessage());
     368            String prefix = "Illegal value for attributes 'lat', 'lon' on node with ID 978. Got 'nan', 'nan'.";
     369            assertThat(e.getMessage(), anyOf(
     370                    is(prefix + " (at line 4, column 151). 336 bytes have been read"),
     371                    is(prefix + " (at line 5, column 179). 338 bytes have been read") // GitHub Actions
     372            ));
    366373        }
    367374    }
Note: See TracChangeset for help on using the changeset viewer.