Skip to content

Commit

Permalink
Add some backwards compatibility for an older version of Haystack 4
Browse files Browse the repository at this point in the history
  • Loading branch information
garethj2 committed Jan 13, 2025
1 parent 1f2cdae commit ca296b5
Show file tree
Hide file tree
Showing 3 changed files with 663 additions and 1 deletion.
42 changes: 42 additions & 0 deletions spec/core/HNamespace.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import '../matchers'
import '../customMatchers'
import { makeProjectHaystackNormalizer } from '../readDefs'
import { valueIsKind } from '../../src/core/HVal'
import { readFile } from '../file'

describe('HNamespace', function (): void {
let defs: HNamespace
Expand Down Expand Up @@ -529,6 +530,47 @@ describe('HNamespace', function (): void {
'weather-point',
])
})

it('returns the feature names using an older version of defs', async () => {
defs = new HNamespace(
ZincReader.readValue(await readFile('oldDefs.zinc')) as HGrid
)

expect(defs.tagOnNames).toEqual([
'air-input',
'site',
'space',
'lib',
'blowdown-water-input',
'chilled-water-input',
'condensate-input',
'condenser-water-input',
'chiller',
'point',
'cur-point',
'entity',
'def',
'domestic-water-input',
'elec-input',
'controller',
'equip',
'filetype',
'floor',
'fuelOil-input',
'gasoline-input',
'geoPlace',
'his-point',
'hot-water-input',
'makeup-water-input',
'naturalGas-input',
'refrig-input',
'steam-input',
'meter',
'weatherStation',
'motor',
'weather-point',
])
})
}) // #tagOnNames

describe('#tagOnIndices', function (): void {
Expand Down
Loading

0 comments on commit ca296b5

Please sign in to comment.