github.com/hyperledger/burrow@v0.34.5-0.20220512172541-77f09336001d/js/src/test/47.test.ts (about)

     1  import * as assert from 'assert';
     2  import { compile } from '../contracts/compile';
     3  import { client } from './test';
     4  
     5  describe('#47', function () {
     6    it('#47', async () => {
     7      const source = `
     8        pragma solidity >=0.0.0;
     9        contract Test{
    10          string _withSpace = "  Pieter";
    11          string _withoutSpace = "Pieter";
    12  
    13          function getWithSpaceConstant() public view returns (string memory) {
    14            return _withSpace;
    15          }
    16  
    17          function getWithoutSpaceConstant () public view returns (string memory) {
    18            return _withoutSpace;
    19          }
    20        }
    21      `;
    22      const contract = compile(source, 'Test');
    23      return contract
    24        .deploy(client)
    25        .then((instance: any) => Promise.all([instance.getWithSpaceConstant(), instance.getWithoutSpaceConstant()]))
    26        .then(([withSpace, withoutSpace]) => {
    27          assert.deepStrictEqual(withSpace, ['  Pieter']);
    28          assert.deepStrictEqual(withoutSpace, ['Pieter']);
    29        });
    30    });
    31  });