本文整理汇总了TypeScript中assert.notEqual函数的典型用法代码示例。如果您正苦于以下问题:TypeScript notEqual函数的具体用法?TypeScript notEqual怎么用?TypeScript notEqual使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了notEqual函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should exist', () => {
assert.notEqual(typeof localDrive._options, 'undefined');
assert.notEqual(typeof remoteDrive._options, 'undefined');
});
开发者ID:dmytrobanasko,项目名称:google-api-nodejs-client,代码行数:4,代码来源:test.drive.v2.ts
示例2: buildBlade
//.........这里部分代码省略.........
// the max height of the div
for (var i = 0; i < vertIndicesInLayers[divIndex].length; i++) {
sword.geometryData.vertices[vertIndicesInLayers[divIndex][i] * 3 + 1] = baseSectionLength + midSectionLength;
}
break;
} else {
// randomly determine a height and modify the verts
var minDivLength = equalMidDivLength * 0.5;
var maxDivLength = spaceLeft - (minDivLength * (numMidDivs - Math.abs(divIndex - (numBaseDivs))));
var divLength = getRandomFloat(this.randGenerator, minDivLength, maxDivLength);
// Change y value for all verts at this level
for (var i = 0; i < vertIndicesInLayers[divIndex].length; i++) {
sword.geometryData.vertices[vertIndicesInLayers[divIndex][i] * 3 + 1] = divLength + (midSectionLength - spaceLeft) + baseSectionLength;
}
spaceLeft = spaceLeft - divLength;
}
}
}
if (genParams.equalTipDivs) {
for (var divIndex = numBaseDivs + numMidDivs + 1; divIndex <= totalBladeDivs; divIndex++) {
for(var i = 0; i < vertIndicesInLayers[divIndex].length; i++) {
sword.geometryData.vertices[vertIndicesInLayers[divIndex][i] * 3 + 1] = (equalTipDivLength * Math.abs(divIndex - (numBaseDivs + numMidDivs))) + baseSectionLength + midSectionLength;
}
}
} else {
// We need to loop through each layer in the base and set the height
// Space left to work with in this div
var spaceLeft = tipSectionLength;
// Loop through each level in the division
for (var divIndex = numBaseDivs + numMidDivs + 1; divIndex <= totalBladeDivs; divIndex++) {
if (divIndex == totalBladeDivs) {
// This is the last layer so we set thhe verts to be at
// the max height of the div
for(var i = 0; i < vertIndicesInLayers[divIndex].length; i++) {
sword.geometryData.vertices[vertIndicesInLayers[divIndex][i] * 3 + 1] = bladeLength;
}
} else {
// randomly determine a height and modify the verts
var minDivLength = equalTipDivLength * 0.5;
var maxDivLength = spaceLeft - (minDivLength * (numTipDivs - Math.abs(divIndex - (numBaseDivs + numMidDivs))));
var divLength = getRandomFloat(this.randGenerator, minDivLength, maxDivLength);
// Change y value for all verts at this level
for (var i = 0; i < vertIndicesInLayers[divIndex].length; i++) {
sword.geometryData.vertices[vertIndicesInLayers[divIndex][i] * 3 + 1] = divLength + (tipSectionLength - spaceLeft) + (baseSectionLength + midSectionLength);
}
spaceLeft = spaceLeft - divLength;
}
}
}
if (this.verbose) {
console.log(`Vertices after height mod:\n${sword.geometryData.toString("vertex")}`);
}
// Place a point at the tip of the blade
var topFaceVertIndices: number[] = SwordGenerator.getTopVertIndices(sword.geometryData.vertices);
sword.geometryData.vertices = SwordGenerator.createBladeTip(sword.geometryData.vertices, topFaceVertIndices);
// Ensure that the height of the blade matches the template
for (var i = 0; i < topFaceVertIndices.length; i++) {
Assert.equal(sword.geometryData.vertices[topFaceVertIndices[i] * 3 + 1], template.length,
`ERROR:: Blade does not match template expected ${template.length} was ${sword.geometryData.vertices[topFaceVertIndices[i] * 3 + 1]}`);
}
// Check number of vertices
Assert.notEqual(sword.geometryData.vertices.length, 0, "ERROR:: Model does not have any vertices defined");
Assert.equal(sword.geometryData.vertices.length % 3, 0, "ERROR:: Model has the incorrect number of vertex components");
// Check the number of triangles
Assert.notEqual(sword.geometryData.triangles.length, "ERROR:: Model does not have any triangles defined");
Assert.equal(sword.geometryData.triangles.length % 3, 0, "ERROR:: Model has the incorrect number of triangle components");
// Add colors for the sword blade
for (var i = 0; i < (sword.geometryData.vertices.length / 3); i++) {
sword.geometryData.addColor(0.5, 0.5, 0.5);
}
// Check number of colors
Assert.notEqual(sword.geometryData.colors.length, 0, "ERROR:: Model does not have any colors defined");
Assert.equal(sword.geometryData.colors.length % 3, 0, "ERROR:: Model has the incorrect number of color components");
// Add normals for the sword blade
for (var i = 0; i < (sword.geometryData.vertices.length / 3); i++) {
sword.geometryData.addNormal(1.0, 0.0, 0.0);
}
// Check number of normals
Assert.notEqual(sword.geometryData.normals.length, 0, "ERROR:: Model does not have any normals defined");
Assert.equal(sword.geometryData.normals.length % 3, 0, "ERROR:: Model has the incorrect number of normal components");
return sword;
}
开发者ID:ShiJbey,项目名称:WeaponGenerator,代码行数:101,代码来源:SwordGenerator.ts
示例3: it
it("tests unstaging of second file", function () {
doesNotThrow(() => test_repo.unstage("test2.txt"));
assert.notEqual(test_repo.staged[1], "test2.txt",
"failed unstaging of second file");
});
开发者ID:STALKER2010,项目名称:jerk,代码行数:5,代码来源:common.test.ts
示例4: test
test("Boolean checks", () => {
assert.equal(true, true, "true is not true");
assert.notEqual(true, false, "true is false");
assert.equal(false, false, "false is not false");
assert.notEqual(false, true, "false is true");
});
开发者ID:rlugojr,项目名称:omnisharp-vscode,代码行数:6,代码来源:sanity.test.ts
示例5: done
remoteDrive.files.get({}, (e: Error) => {
assert.notEqual(e, null);
done();
});
开发者ID:sgaluza,项目名称:google-api-nodejs-client,代码行数:4,代码来源:test.path.ts
示例6: test
test('register and resolve decoration type', () => {
var s = new CodeEditorServiceImpl();
s.registerDecorationType('example', options);
assert.notEqual(s.resolveDecorationOptions('example', false), undefined);
});
开发者ID:1Hgm,项目名称:vscode,代码行数:5,代码来源:decorationRenderOptions.test.ts
示例7: test
test('boolean', () => {
assert.equal(hash(true), hash(true));
assert.notEqual(hash(true), hash(false));
});
开发者ID:DonJayamanne,项目名称:vscode,代码行数:4,代码来源:hash.test.ts
示例8: AutoRest
@test @timeout(60000) async "suppression"() {
const autoRest = new AutoRest(new RealFileSystem(), ResolveUri(CreateFolderUri(__dirname), "resources/literate-example/"));
autoRest.Message.Subscribe((_, m) => m.Channel === Channel.Fatal ? console.error(m.Text) : "");
// reference run
await autoRest.ResetConfiguration();
await autoRest.AddConfiguration({ "azure-arm": true });
let numWarningsRef: number;
{
const messages: Message[] = [];
const dispose = autoRest.Message.Subscribe((_, m) => { if (m.Channel == Channel.Warning) { messages.push(m) } });
await autoRest.Process().finish;
numWarningsRef = messages.length;
dispose();
}
assert.notEqual(numWarningsRef, 0);
// muted run
await autoRest.ResetConfiguration();
await autoRest.AddConfiguration({ "azure-arm": true });
await autoRest.AddConfiguration({ directive: { suppress: ["AvoidNestedProperties", "ModelTypeIncomplete", "DescriptionMissing", "PutRequestResponseValidation"] } });
{
const messages: Message[] = [];
const dispose = autoRest.Message.Subscribe((_, m) => { if (m.Channel == Channel.Warning) { messages.push(m) } });
await autoRest.Process().finish;
if (messages.length > 0) {
console.log("Should have been muted but found:");
console.log(JSON.stringify(messages, null, 2));
}
assert.strictEqual(messages.length, 0);
dispose();
}
// makes sure that neither all nor nothing was returned
const pickyRun = async (directive: any) => {
await autoRest.ResetConfiguration();
await autoRest.AddConfiguration({ "azure-arm": true });
await autoRest.AddConfiguration({ directive: directive });
{
const messages: Message[] = [];
const dispose = autoRest.Message.Subscribe((_, m) => { if (m.Channel == Channel.Warning) { messages.push(m) } });
await autoRest.Process().finish;
if (messages.length === 0 || messages.length === numWarningsRef) {
console.log(JSON.stringify(messages, null, 2));
}
assert.notEqual(messages.length, 0);
assert.notEqual(messages.length, numWarningsRef);
// console.log(directive, messages.length);
dispose();
}
};
// not all types
await pickyRun({ suppress: ["AvoidNestedProperties"] });
// certain paths
await pickyRun({ suppress: ["AvoidNestedProperties", "ModelTypeIncomplete", "DescriptionMissing"], where: "$..properties" });
await pickyRun({ suppress: ["AvoidNestedProperties"], where: "$..properties.properties" });
// multiple directives
await pickyRun([{ suppress: ["AvoidNestedProperties"], where: "$..properties.properties" }]);
await pickyRun([
{ suppress: ["AvoidNestedProperties"] },
{ suppress: ["ModelTypeIncomplete"] }
]);
await pickyRun([
{ suppress: ["DescriptionMissing"] },
{ suppress: ["ModelTypeIncomplete"] }
]);
// document
await pickyRun({ suppress: ["AvoidNestedProperties"], where: "$..properties.properties", from: "swagger.md" });
}
开发者ID:jianghaolu,项目名称:AutoRest,代码行数:77,代码来源:directive.ts
示例9: it
it('should fail to convert bytes beyound ascii.', () => {
assert.notEqual(
readBytesToISO8859(Buffer.from(expectedStr, 'utf8')),
expectedStr,
);
});
开发者ID:creeperyang,项目名称:id3-parser,代码行数:6,代码来源:utils.spec.ts
注:本文中的assert.notEqual函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论