This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import assert from 'node:assert/strict'
|
||||
import test from 'node:test'
|
||||
|
||||
import { isMaritimePort } from './maritime.js'
|
||||
|
||||
test('accepts curated coastal LOCODE ports', () => {
|
||||
assert.equal(isMaritimePort({ locode: 'NGLAG' }), true)
|
||||
assert.equal(isMaritimePort({ locode: 'CDBNW' }), true)
|
||||
})
|
||||
|
||||
test('rejects inland ports even when UN/LOCODE function 1 is present', () => {
|
||||
assert.equal(isMaritimePort({ locode: 'CMGOU', function_code: '1-34----' }), false)
|
||||
assert.equal(isMaritimePort({ locode: 'CGOYO', function_code: '1-3-----' }), false)
|
||||
})
|
||||
|
||||
test('accepts an explicitly curated database record', () => {
|
||||
assert.equal(isMaritimePort({ locode: 'CUSTOM', is_maritime_port: true }), true)
|
||||
})
|
||||
Reference in New Issue
Block a user