-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
- Loading branch information
1 parent
870e397
commit 04830dd
Showing
3 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* @file Type Tests - NumberLiteral | ||
* @module esast/nodes/tests/unit-d/NumberLiteral | ||
*/ | ||
|
||
import type { Literal } from '@flex-development/esast' | ||
import type TestSubject from '../literal-number' | ||
|
||
describe('unit-d:nodes/NumberLiteral', () => { | ||
it('should extend Literal', () => { | ||
expectTypeOf<TestSubject>().toMatchTypeOf<Literal>() | ||
}) | ||
|
||
it('should match [type: "number"]', () => { | ||
expectTypeOf<TestSubject>().toHaveProperty('type').toEqualTypeOf<'number'>() | ||
}) | ||
|
||
it('should match [value: number]', () => { | ||
expectTypeOf<TestSubject>().toHaveProperty('value').toEqualTypeOf<number>() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** | ||
* @file Nodes - NumberLiteral | ||
* @module esast/nodes/NumberLiteral | ||
*/ | ||
|
||
import type { Literal } from '@flex-development/esast' | ||
|
||
/** | ||
* A literal integer or floating point number. | ||
* | ||
* @see {@linkcode Literal} | ||
* | ||
* @extends {Literal} | ||
*/ | ||
interface NumberLiteral extends Literal { | ||
/** | ||
* Node type. | ||
*/ | ||
type: 'number' | ||
|
||
/** | ||
* Plain value. | ||
*/ | ||
value: number | ||
} | ||
|
||
export type { NumberLiteral as default } |