-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into conroy/noticesrefactor
- Loading branch information
Showing
11 changed files
with
139 additions
and
45 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
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
4 changes: 2 additions & 2 deletions
4
...ws-cdk/aws-ec2-alpha/test/integ.subnet-v2.js.snapshot/aws-cdk-vpcv2-alpha-new.assets.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
73 changes: 49 additions & 24 deletions
73
packages/@aws-cdk/aws-ec2-alpha/test/integ.subnet-v2.js.snapshot/manifest.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
10 changes: 5 additions & 5 deletions
10
packages/@aws-cdk/aws-ec2-alpha/test/integ.subnet-v2.js.snapshot/tree.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,38 @@ | ||
import { CidrBlock } from '../lib/util'; | ||
|
||
describe('Tests for the CidrBlock.rangesOverlap method to check if IPv4 ranges overlap', () =>{ | ||
test('Should return false for non-overlapping IP ranges', () => { | ||
const testCidr = new CidrBlock('10.0.0.0/16'); | ||
const range1 = ['10.0.0.0', '10.0.15.255'] as [string, string]; | ||
const range2 = ['10.0.128.0', '10.0.143.255'] as [string, string]; | ||
expect(testCidr.rangesOverlap(range1, range2)).toBe(false); | ||
}); | ||
|
||
test('Should return true for overlapping IP ranges', () => { | ||
const testCidr = new CidrBlock('54.0.0.0/17'); | ||
const range1 = ['54.0.0.0', '54.0.127.255'] as [string, string]; | ||
const range2 = ['54.0.100.0', '54.0.192.255'] as [string, string]; | ||
expect(testCidr.rangesOverlap(range1, range2)).toBe(true); | ||
}); | ||
|
||
test('Should return true for overlapping IP ranges where one range is completely inside the other', () => { | ||
const testCidr = new CidrBlock('10.0.0.0/16'); | ||
const range1 = ['10.0.0.0', '10.0.127.255'] as [string, string]; | ||
const range2 = ['10.0.64.0', '10.0.65.255'] as [string, string]; | ||
expect(testCidr.rangesOverlap(range1, range2)).toBe(true); | ||
}); | ||
|
||
test('Should return true for overlapping IP ranges where the last IP of one range is the first IP of the other', () => { | ||
const testCidr = new CidrBlock('10.0.0.0/16'); | ||
const range1 = ['10.0.0.0', '10.0.15.255'] as [string, string]; | ||
const range2 = ['10.0.15.255', '10.0.255.255'] as [string, string]; | ||
expect(testCidr.rangesOverlap(range1, range2)).toBe(true); | ||
}); | ||
|
||
test('Should return false for non-overlapping IP ranges where one range starts immediately after the other ends', () => { | ||
const testCidr = new CidrBlock('10.0.0.0/16'); | ||
const range1 = ['10.0.0.0', '10.0.15.255'] as [string, string]; | ||
const range2 = ['10.0.16.0', '10.0.19.255'] as [string, string]; | ||
expect(testCidr.rangesOverlap(range1, range2)).toBe(false); | ||
}); | ||
}); |
Oops, something went wrong.