當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript assert.notEqual函數代碼示例

本文整理匯總了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;未經允許,請勿轉載。